Euclidean linear algebra functions.
More...
|
function | multmatrix_p (c, m) |
| Multiply all coordinates by a 4x4 transformation matrix in 3D. More...
|
|
function | translate_p (c, v) |
| Translate all coordinates dimensions. More...
|
|
function | rotate_p (c, a, v, o=origin3d) |
| Rotate all coordinates about one or more axes in 2D or 3D. More...
|
|
function | scale_p (c, v) |
| Scale all coordinates dimensions. More...
|
|
function | resize_p (c, v) |
| Scale all coordinates dimensions proportionately to fit inside a region. More...
|
|
Euclidean linear algebra functions.
◆ multmatrix_p()
function multmatrix_p |
( |
c |
, |
|
|
m |
|
|
) |
| |
Multiply all coordinates by a 4x4 transformation matrix in 3D.
- Parameters
-
c | <coords-3d> A list of 3d coordinate points. |
m | <matrix-4x4> A 4x4 transformation matrix (decimal-list-4-list4). |
- Returns
- <coords-3d> A list of 3d coordinate points multiplied by the transformation matrix.
See Wikipedia and multmatrix for more information.
◆ resize_p()
function resize_p |
( |
c |
, |
|
|
v |
|
|
) |
| |
Scale all coordinates dimensions proportionately to fit inside a region.
- Parameters
-
c | <coords-nd> A list of nd coordinate points. |
v | <decimal-list-n> A list of bounds for each dimension. |
- Returns
- <coords-nd> A list of proportionately scaled coordinate points which exactly fit the region bounds
v
.
◆ rotate_p()
function rotate_p |
( |
c |
, |
|
|
a |
, |
|
|
v |
, |
|
|
o |
= origin3d |
|
) |
| |
Rotate all coordinates about one or more axes in 2D or 3D.
- Parameters
-
c | <coords-3d | coords-2d> A list of 3d or 2d coordinate points. |
a | <decimal-list-3 | decimal> The axis rotation angle. A list [ax, ay, az] or a single decimal to specify az only. |
v | <vector-3d> An arbitrary axis for the rotation. When specified, the rotation angle will be a or az about the line v that passes through point o . |
o | <point-3d> A 3d point origin for the rotation. Ignored when v is not specified. |
- Returns
- <coords-3d | coords-2d> A list of 3d or 2d rotated coordinates. Rotation order is rz, ry, rx.
See Wikipedia for more information on transformation matrix and axis rotation.
◆ scale_p()
function scale_p |
( |
c |
, |
|
|
v |
|
|
) |
| |
Scale all coordinates dimensions.
- Parameters
-
c | <coords-nd> A list of nd coordinate points. |
v | <decimal-list-n> A list of scalers for each dimension. |
- Returns
- <coords-nd> A list of scaled coordinate points.
◆ translate_p()
function translate_p |
( |
c |
, |
|
|
v |
|
|
) |
| |
Translate all coordinates dimensions.
- Parameters
-
c | <coords-nd> A list of nd coordinate points. |
v | <decimal-list-n> A list of translations for each dimension. |
- Returns
- <coords-nd> A list of translated coordinate points.
See Wikipedia for more information and transformation matrix.