222 ) = (s ==
"c") ?
"cartesian"
223 : (s ==
"p") ?
"polar"
224 : (s ==
"y") ?
"cylindrical"
225 : (s ==
"s") ?
"spherical"
248 function _coordinate_unit_c2
260 (to ==
"p") ? (d != 2) ? undef
264 r = sqrt(pow(c[0],2) + pow(c[1],2)),
265 aa = atan2(c[1], c[0]),
272 : (to ==
"y") ? (d != 3) ? undef
276 r = sqrt(pow(c[0],2) + pow(c[1],2)),
277 aa = atan2(c[1], c[0]),
284 : (to ==
"s") ? (d != 3) ? undef
288 r = sqrt(pow(c[0],2) + pow(c[1],2) + pow(c[2],2)),
289 aa = atan2(c[1], c[0]),
292 pa = (r == 0) ? 0 : acos(c[2] / r)
314 function _coordinate_unit_2c
326 (from ==
"p") ? (d != 2 ) ? undef
337 : (from ==
"y") ? (d != 3 ) ? undef
348 : (from ==
"s") ? (d != 3 ) ? undef
352 x = c[0]*sin(c[2])*cos(c[1]),
353 y = c[0]*sin(c[2])*sin(c[1]),
384 : let( cc = _coordinate_unit_2c( c, from ) )
385 (cc == undef) ? undef
386 : _coordinate_unit_c2( cc, to );
437 coordinate([(t == true) ? r : r*p[0], p[1]], from="p", to="c")
462 coordinate([(t == true) ? r : r*i[0], i[1]], from="p", to="c")
488 coordinate([(t == true) ? r : r*s[0], s[1], s[2]], from="s", to="c")
513 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.
function coordinate_scale2d_p2c(c, r, t=false)
Radially scale and convert a list of 2d polar coordinates to cartesian.
function coordinate(c, from=coordinate_unit_default, to=coordinate_unit_base)
Convert a point from one coordinate system to another.
function coordinate_scale3d_s2c(c, r, t=false)
Spherically scale and convert a list of 3d spherical coordinates to cartesian.
function coordinate_inv(c, from=coordinate_unit_base, to=coordinate_unit_default)
Convert a point from one coordinate system to another (direction-swapped defaults).
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_unit_name(s=coordinate_unit_default)
Return the name of the given coordinate system identifier.
coordinate_positive_angle