132 ) = (s ==
"c") ?
"cartesian"
133 : (s ==
"p") ?
"polar"
134 : (s ==
"y") ?
"cylindrical"
135 : (s ==
"s") ?
"spherical"
149 function coordinate_unit_c2
161 (to ==
"p") ? (d != 2 ) ? undef
165 r = sqrt(pow(c[0],2) + pow(c[1],2)),
166 aa = atan2(c[1], c[0]),
173 : (to ==
"y") ? (d != 3 ) ? undef
177 r = sqrt(pow(c[0],2) + pow(c[1],2)),
178 aa = atan2(c[1], c[0]),
180 z = (c[2] !=undef) ? c[2] : 0
186 : (to ==
"s") ? (d != 3 ) ? undef
190 r = sqrt(pow(c[0],2) + pow(c[1],2) + pow(c[2],2)),
191 aa = atan2(c[1], c[0]),
211 function coordinate_unit_2c
223 (from ==
"p") ? (d != 2 ) ? undef
234 : (from ==
"y") ? (d != 3 ) ? undef
240 z = (c[2] != undef) ? c[2] : 0
246 : (from ==
"s") ? (d != 3 ) ? undef
250 x = c[0]*sin(c[2])*cos(c[1]),
251 y = c[0]*sin(c[2])*sin(c[1]),
275 : coordinate_unit_c2( coordinate_unit_2c( c, from ), to );
294 : coordinate_unit_c2( coordinate_unit_2c( c, from ), to );
319 coordinate([(t == true) ? r : r*p[0], p[1]], from="p", to="c")
344 coordinate([(t == true) ? r : r*i[0], i[1]], from="p", to="c")
370 coordinate([(t == true) ? r : r*s[0], s[1], s[2]], from="s", to="c")
395 coordinate([(t == true) ? r : r*i[0], i[1], i[2]], from="s", to="c")
function line_dim(l)
Return the number of dimensions of a line or vector.
function is_point(v)
Test if a value defines a point.
coordinate_unit_base
<string> The base units for value storage.
function coordinate(c, from=coordinate_unit_default, to=coordinate_unit_base)
Convert point from one coordinate system to another.
function coordinate_inv(c, from=coordinate_unit_base, to=coordinate_unit_default)
Convert point from one coordinate system to another.
function coordinate_scale2d_cpc(c, r, t=false)
Radially scale a list of 2d cartesian coordinates.
function coordinate_scale3d_csc(c, r, t=false)
Spherically scale a list of 3d cartesian coordinates.
function coordinate_scale2d_p2c(p, r, t=false)
Radially scale and convert a list of 2d polar coordinates to cartesian.
function coordinate_unit_name(s=coordinate_unit_default)
Return the name of the given coordinate system identifier.
function coordinate_scale3d_s2c(s, r, t=false)
Spherically scale and convert a list of 3d spherical coordinates to cartesian.
coordinate_unit_default
<string> The default units when unspecified.
coordinate_positive_angle
<boolean> When converting to angular measures add 360 to negative angles.