Gg.M33D square matrices.
type t = m3The type for 3D square matrices.
type v = v3The type for rows and columns as vectors.
val v :
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
m3v e00 e01 e02 e10 e11 e12 e20 e21 e22 is a matrix whose components are specified in row-major order
val el : int -> int -> m3 -> floatel i j a is the element aij. See also the direct element accessors.
Raises Invalid_argument if i or j is not in [0;dim[.
row i a is the ith row of a.
Raises Invalid_argument if i is not in [0;dim[.
col j a is the jth column of a.
Raises Invalid_argument if j is not in [0;dim[.
of_m2_v2 m v is the matrix whose first two rows are those of m,v side by side and the third is 0 0 1.
mul a b is the matrix multiplication a * b.
val trace : m3 -> floattrace a is the matrix trace trace(a).
val det : m3 -> floatdet a is the determinant |a|.
inv a is the inverse matrix a-1.
rot2 pt theta rotates 2D space around the point pt by theta radians. pt defaults to P2.o.
rigid2 move theta is the rigid body transformation of 2D space that rotates by theta radians and then translates by move.
srigid2 move theta scale is like rigid2 but starts by scaling according to scale.
rot3_map u v rotates 3D space to map the unit vector u on the unit vector v.
rot_axis v theta rotates 3D space by theta radians around the unit vector v.
rot3_zyx r rotates 3D space first by V3.x r radians around the x-axis, then by V3.y r radians around the y-axis and finally by V3.z r radians around the z-axis.
mapi f a is like map but the element indices are also given.
val fold : ('a -> float -> 'a) -> 'a -> m3 -> 'afold f acc a is f (...(f (f acc a00) a10)...).
val foldi : ('a -> int -> int -> float -> 'a) -> 'a -> m3 -> 'afoldi f acc a is f (...(f (f acc 0 0 a00) 1 0 a10)...).
val iter : (float -> unit) -> m3 -> unititer f a is f a00; f a10; ...
val iteri : (int -> int -> float -> unit) -> m3 -> unititeri f a is f 0 0 a00; f 1 0 a10; ...
val for_all : (float -> bool) -> m3 -> boolfor_all p a is p a00 && p a10 && ...
val exists : (float -> bool) -> m3 -> boolexists p a is p a00 || p a10 || ...
equal_f eq a b tests a and b like equal but uses eq to test floating point values.
compare a b is Stdlib.compare a b. That is lexicographic comparison in column-major order.
compare_f cmp a b compares a and b like compare but uses cmp to compare floating point values.
val pp : Stdlib.Format.formatter -> m3 -> unitpp ppf a prints a textual representation of a on ppf.
val pp_f :
(Stdlib.Format.formatter -> float -> unit) ->
Stdlib.Format.formatter ->
m3 ->
unitpp_f pp_e ppf a prints a like pp but uses pp_e to print floating point values.
val e00 : m3 -> floatval e01 : m3 -> floatval e02 : m3 -> floatval e10 : m3 -> floatval e11 : m3 -> floatval e12 : m3 -> floatval e20 : m3 -> floatval e21 : m3 -> floatval e22 : m3 -> float