85 sqrt(
sum([
for (i=[0:d-1]) (p1[i]-p2[i])*(p1[i]-p2[i])]))
86 : sqrt(
sum([for (i=[0:d-1]) p1[i]*p1[i]]));
109 ) = ((p2[0]-p1[0]) * (p3[1]-p1[1]) - (p3[0]-p1[0]) * (p2[1]-p1[1]));
128 ) = (len(v) == 3) ? v : [v[0], v[1], 0];
147 ) =
is_defined(len(l[0])) ? len(l[0]) : len(l);
162 ) =
is_iterable(l[0]) ? (len(l)>1) ? l[1] : l[0] : l;
194 : (len(l) == 1) ? l[0]
195 : (len(l) == 2) ? (l[1]-l[0])
403 (len(pn) == 3) ? pn : (len(pn) == 2) ? [pn[0], pn[1], 0]: undef
407 q = [
for (i=pn) (len(i) == 3) ? i : (len(i) == 2) ? [i[0], i[1], 0]: undef]
409 (len(pn) == 1) ? q[0]
410 : (len(pn) == 2) ? cross(q[0], q[1])
411 : cross(q[0]-q[1], q[2]-q[1]) * ((cw ==
true) ? 1 : -1);
function get_pnorm2nv(pn, cw=true)
Convert a planes' normal specification into a normal vector.
function is_left_ppp(p1, p2, p3)
Test if a point is left, on, or right of an infinite line in a Euclidean 2d-space.
function distance_pp(p1, p2)
Compute the distance between two Euclidean points.
function cross_ll(l1, l2)
Compute the cross product of two lines (or vectors) in a Euclidean 3d or 2d-space.
function dot_ll(l1, l2)
Compute the dot product of two lines (or vectors).
function are_coplanar_lll(l1, l2, l3, d=6)
Test if three lines (or vectors) are coplanar in Euclidean 3d-space.
function defined_or(v, d)
Return a value when it is defined or a default value when it is not.
function dimension_2to3_v(v)
Return 3d vector unchanged or add a zeroed third dimension to 2d vector.
function sum(v, i1, i2)
Compute the sum of a list of numbers.
function get_line_ip(l)
Return the initial point of a Euclidean line (or vector).
function get_line_dim(l)
Return the number of dimensions of a Euclidean line (or vector).
function not_defined(v)
Test if a value is not defined.
function unit_l(l)
Compute the normalized unit vector of a Euclidean line (or vector).
function get_line_tp(l)
Return the terminal point of a Euclidean line (or vector).
function is_defined(v)
Test if a value is defined.
function angle_ll(l1, l2)
Compute the angle between two lines (or vectors) in a Euclidean 3d or 2d-space.
function consts(l, v, u=false)
Create a sequence of constant or incrementing elements.
function striple_lll(l1, l2, l3)
Compute the scalar triple product of three lines (or vectors) in a Euclidean 3d or 2d-space...
function angle_lll(l1, l2, n)
Compute the angle between two lines (or vectors) in a Euclidean 3d-space.
function is_iterable(v)
Test if a value has multiple parts and is iterable.
function get_line2origin(l)
Shift a Euclidean line (or vector) to the origin.
function dround(v, d=6)
Round all numerical values of a list to a fixed number of decimal point digits.