Scad_ml.Affine2A 2d affine transformation matrix.
To be used with OpenSCADs multmatrix, which is applied in this library with Scad.affine.
val id : tThe identity matrix.
val trace : t -> floattrace t
Sum the elements on the main diagonal (upper left to lower right) of t.
val get : t -> int -> int -> floatget t r c
Get the element at row and column of t. Equivalent to t.(r).(c). Raises Invalid_argument if access is out of bounds.
compose a b
Compose the affine transformations a and b. Equivalent to mul b a, which when applied, will perform the transformation a, then the transformation b.
of_rows rows
Create an 2d affine transformation matrix from two rows. The last row is set to 0., 0., 1..
val of_row_matrix_exn : float array array -> tof_row_matrix_exn m
Convert the float matrix m into a t if it is the correct shape (3 x 3), otherwise raise Invalid_argument.
val of_row_matrix : float array array -> ( t, string ) Stdlib.resultof_row_matrix m
Convert the float matrix m into a t if it is the correct shape (3 x 3).
translation v
Create a 2d affine transformation matrix from the xy translation vector v.
val xtrans : float -> txtrans x
Create a 2d affine transformation matrix that applies a translation of x distance along the x-axis.
val ytrans : float -> tytrans y
Create a 2d affine transformation matrix that applies a translation of y distance along the y-axis.
rotate ?about r
Create an affine transformation matrix that applies a rotation of r radians around the origin (or the point about if provided).
zrot ?about r
Create an affine transformation matrix that applies a rotation of r radians around the origin (or the point about if provided). Alias of rotate.
align a b
Compute an affine transformation matrix that would bring the vector a into alignment with b.
scaling v
Create a 2d affine transformation matrix from the xyz scaling vector v.
mirror ax
Create an affine transformation matrix that applies a reflection across the axis ax.
val skew : float -> float -> tskew xa ya
Create an affine transformation matrix that applies a skew transformation along the xy plane.
xa: skew angle (in radians) in the direction of the x-axisya: skew angle (in radians) in the direction of the y-axistransform t v
Apply the 2d affine transformation matrix t to the vector v.
val to_string : t -> string