68 m11=m[0][0], m12=m[0][1], m13=m[0][2], m14=m[0][3],
69 m21=m[1][0], m22=m[1][1], m23=m[1][2], m24=m[1][3],
70 m31=m[2][0], m32=m[2][1], m33=m[2][2], m34=m[2][3]
76 x = ci[0], y = ci[1], z = ci[2]
78 [m11*x+m12*y+m13*z+m14, m21*x+m22*y+m23*z+m24, m31*x+m32*y+m33*z+m34]
106 [
for (ci=c) [
for (di=[0 : d-1]) ci[di] + w[di]]];
143 cg = cos(az), sg = sin(az),
145 rc = (d == 2) ? [
for (ci=c) [cg*ci[0]-sg*ci[1], sg*ci[0]+cg*ci[1]]]
147 : (is_undef(v) || is_list(a)) ?
153 ca = cos(ax), cb = cos(ay),
154 sa = sin(ax), sb = sin(ay),
157 m12 = cg*sa*sb-ca*sg,
158 m13 = ca*cg*sb+sa*sg,
161 m22 = ca*cg+sa*sb*sg,
162 m23 = -cg*sa+ca*sb*sg,
168 multmatrix_p(c, [[m11,m12,m13,0], [m21,m22,m23,0], [m31,m32,m33,0]])
171 vx = v[0], vy = v[1], vz = v[2],
172 vx2 = vx*vx, vy2 = vy*vy, vz2 = vz*vz,
178 ox = o[0], oy = o[1], oz = o[2],
182 m11 = vx2+(vy2+vz2)*cg,
183 m12 = vx*vy*oc-vz*ll*sg,
184 m13 = vx*vz*oc+vy*ll*sg,
185 m14 = (ox*(vy2+vz2)-vx*(oy*vy+oz*vz))*oc+(oy*vz-oz*vy)*ll*sg,
187 m21 = vx*vy*oc+vz*ll*sg,
188 m22 = vy2+(vx2+vz2)*cg,
189 m23 = vy*vz*oc-vx*ll*sg,
190 m24 = (oy*(vx2+vz2)-vy*(ox*vx+oz*vz))*oc+(oz*vx-ox*vz)*ll*sg,
192 m31 = vx*vz*oc-vy*ll*sg,
193 m32 = vy*vz*oc+vx*ll*sg,
194 m33 = vz2+(vx2+vy2)*cg,
195 m34 = (oz*(vx2+vy2)-vz*(ox*vx+oy*vy))*oc+(ox*vy-oy*vx)*ll*sg
197 multmatrix_p(c, [[m11,m12,m13,m14], [m21,m22,m23,m24], [m31,m32,m33,m34]])/l2
219 [for (ci=c) [for (di=[0 : d-1]) ci[di] * w[di]]];
239 m = [for (i=[0 : d-1]) let (cv = [for (ci=c) (ci[i])]) [min(cv), max(cv)]],
242 [for (ci=c) [for (di=[0 : d-1]) ci[di]/s[di] * w[di]]];
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
function is_scalar(v)
Test if a value is a single non-iterable value.
function rotate_p(c, a, v, o=origin3d)
Rotate all coordinates about one or more axes in 2D or 3D.
function multmatrix_p(c, m)
Multiply all coordinates by a 4x4 transformation matrix in 3D.
function resize_p(c, v)
Scale all coordinates dimensions proportionately to fit inside a region.
function translate_p(c, v)
Translate all coordinates dimensions.
function scale_p(c, v)
Scale all coordinates dimensions.