Functions and classes related to coordinate system conversion
cart2pol(x, y[, units]) | Convert from cartesian to polar coordinates |
cart2sph(z, y, x) | Convert from cartesian coordinates (x,y,z) to spherical (elevation, azimuth, radius). |
pol2cart(theta, radius[, units]) | Convert from polar to cartesian coordinates |
sph2cart(*args) | Convert from spherical coordinates (elevation, azimuth, radius) |
Convert from cartesian to polar coordinates
Usage: | theta, radius = pol2cart(x, y, units=’deg’) |
---|
units refers to the units (rad or deg) for theta that should be returned
Convert from cartesian coordinates (x,y,z) to spherical (elevation, azimuth, radius). Output is in degrees.
array3xN[el,az,rad] = cart2sph(array3xN[x,y,z]) OR elevation, azimuth, radius = cart2sph(x,y,z)
If working in DKL space, z = Luminance, y = S and x = LM
Convert from polar to cartesian coordinates
usage:
x,y = pol2cart(theta, radius, units='deg')
Convert from spherical coordinates (elevation, azimuth, radius) to cartesian (x,y,z)