Older Newer
Tue, 24 Dec 2019 10:51:35 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= fc2m =

== Syntax ==

:double fc2m(double x, double y)

== Arguments ==

:x

::A double floating-point pixel x-coordinate.

:y

::A double floating-point pixel y-coordinate.

== Return ==

A double floating-point value giving the distance from the center of the image to the pixel at coordinates [x,y].

== Description ==

Pixels are usually addressed by their cartesian coordinates [x,y], but FilterMeister also allows the use of polar coordinates, and provides a set of functions for conversion between the two systems. Polar coordinates are expressed as [d,m], where 'd' represents the 'direction' to the pixel from the origin and 'm' is the 'magnitude' of the distance from the origin. The c2m() function returns the polar coordinate magnitude 'm' for the pixel at [x,y], relative to the top left corner of the image.

== Example ==

<code>

%ffp

ForEveryTile: {

for (y=y_start; y < y_end; ++y) {

for (x=x_start; x < x_end; ++x) {

for (z=0; z < Z; ++z) {

pset(x, y, z, (256 * ((int)fc2m(x-X/2.0, y-Y/2.0)))/128);

}

}

}

return true;

}

</code>

== See Also ==

c2d, fc2d, r2x, r2y