Next: d, Previous: cspline_find, Up: Internal Routines [Contents][Index]

`ctop( `

`im` [, `x0`, `y0`])

Transforms two-dimensional image

from Cartesian
(rectangular) to polar coordinates. `im`

must be of types
`im``float`

or `double`

.

and `x0`

specify the floating-point Cartesian coordinates of the center of the
polar coordinate system, which defaults to the middle of the image.
`y0`

The result is another two-dimensional image of the same type as

. If `im``p = ctop(im, x0, y0)`

, and if `(r, a)`

are the coordinates of a pixel in the result image, then the coordinates
of the corresponding pixel in

are `im````
(x0 +
r*cos(a*#2pi/dimen(p,0), y0 + r*sin(a*#2pi/dimen(p,1)))
```

. The first
dimension of the result image measures the polar angle, and the second
one the polar radius. The unit of the radius is one pixel. The unit of
the azimuth is `360/dimen(p,1)`

degrees.

Results are included for all (integer) values of the radius for which
the corresponding circle falls completely within the image

. The size of the second dimension of the result is
equal to one more than the radius of the biggest circle (around the
selected center) that falls completely within the image. The result
image samples `im`

at a resolution of approximately one
sample per pixel. The size of the first dimension is approximately
equal to `im``#2pi*r`

if `r`

is the largest included radius. The
exact size of the first dimension is chosen such that it has factors
only from the set 2, 3, and 5, so that Fourier transforms with
`fft`

in that dimension can be performed relatively quickly.

Reverse: ptoc

See also: dimen, fft, sin, #2pi

• ctop Details: |

Next: d, Previous: cspline_find, Up: Internal Routines [Contents][Index]