63 m11=m[0][0], m12=m[0][1], m13=m[0][2], m14=m[0][3],
64 m21=m[1][0], m22=m[1][1], m23=m[1][2], m24=m[1][3],
65 m31=m[2][0], m32=m[2][1], m33=m[2][2], m34=m[2][3]
71 x = ci[0], y = ci[1], z = ci[2]
73 [m11*x+m12*y+m13*z+m14, m21*x+m22*y+m23*z+m24, m31*x+m32*y+m33*z+m34]
101 [
for (ci=c) [
for (di=[0 : d-1]) ci[di] + w[di]]];
138 cg = cos(az), sg = sin(az),
140 rc = (d == 2) ? [
for (ci=c) [cg*ci[0]-sg*ci[1], sg*ci[0]+cg*ci[1]]]
148 ca = cos(ax), cb = cos(ay),
149 sa = sin(ax), sb = sin(ay),
152 m12 = cg*sa*sb-ca*sg,
153 m13 = ca*cg*sb+sa*sg,
156 m22 = ca*cg+sa*sb*sg,
157 m23 = -cg*sa+ca*sb*sg,
163 multmatrix_lp(c, [[m11,m12,m13,0], [m21,m22,m23,0], [m31,m32,m33,0]])
166 vx = v[0], vy = v[1], vz = v[2],
167 vx2 = vx*vx, vy2 = vy*vy, vz2 = vz*vz,
173 ox = o[0], oy = o[1], oz = o[2],
177 m11 = vx2+(vy2+vz2)*cg,
178 m12 = vx*vy*oc-vz*ll*sg,
179 m13 = vx*vz*oc+vy*ll*sg,
180 m14 = (ox*(vy2+vz2)-vx*(oy*vy+oz*vz))*oc+(oy*vz-oz*vy)*ll*sg,
182 m21 = vx*vy*oc+vz*ll*sg,
183 m22 = vy2+(vx2+vz2)*cg,
184 m23 = vy*vz*oc-vx*ll*sg,
185 m24 = (oy*(vx2+vz2)-vy*(ox*vx+oz*vz))*oc+(oz*vx-ox*vz)*ll*sg,
187 m31 = vx*vz*oc-vy*ll*sg,
188 m32 = vy*vz*oc+vx*ll*sg,
189 m33 = vz2+(vx2+vy2)*cg,
190 m34 = (oz*(vx2+vy2)-vz*(ox*vx+oy*vy))*oc+(ox*vy-oy*vx)*ll*sg
192 multmatrix_lp(c, [[m11,m12,m13,m14], [m21,m22,m23,m24], [m31,m32,m33,m34]])/l2
214 [for (ci=c) [for (di=[0 : d-1]) ci[di] * w[di]]];
234 m = [for (i=[0 : d-1]) let (cv = [for (ci=c) (ci[i])]) [min(cv), max(cv)]],
237 [for (ci=c) [for (di=[0 : d-1]) ci[di]/s[di] * w[di]]];
function rotate_lp(c, a, v, o=origin3d)
Rotate all coordinates about one or more axes in Euclidean 2d or 3d space.
function scale_lp(c, v)
Scale all coordinates dimensions.
function second(v)
Return the second element of an iterable value.
function is_scalar(v)
Test if a value is a single non-iterable value.
function edefined_or(v, i, d)
Return an iterable element when it exists or a default value when it does not.
function not_defined(v)
Test if a value is not defined.
origin3d
The origin point coordinate in 3-dimensional Euclidean space.
function is_list(v)
Test if a value is an iterable list of values.
function first(v)
Return the first element of an iterable value.
function resize_lp(c, v)
Scale all coordinates dimensions proportionately to fit inside a region.
function multmatrix_lp(c, m)
Multiply all coordinates by a 4x4 3d-transformation matrix.
function translate_lp(c, v)
Translate all coordinates dimensions.