Gg.M44D square matrices.
type t = m4The type for 4D square matrices.
type v = v4The type for rows and columns as vectors.
val v :
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
float ->
m4v e00 e01 e02 e03 e10 e11 e12 e13 e20 e21 e22 e23 e30 e31 e32 e33 is a matrix whose components are specified in row-major order
of_rows r0 r1 r2 r3 is the matrix whose rows are r0, r1, r2 and r3.
of_cols c0 c1 c2 c3 is the matrix whose columns are c0, c1, c2 and c3.
val el : int -> int -> m4 -> 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[.
col j a is the jth column of a.
Raises Invalid_argument if j is not in [0;dim[.
of_m3_v3 m v is the matrix whose first three rows are those of m,v side by side and the fourth is 0 0 0 1.
mul a b is the matrix multiplication a * b.
val trace : m4 -> floattrace a is the matrix trace trace(a).
val det : m4 -> floatdet a is the determinant |a|.
inv a is the inverse matrix a-1.
See M3.srigid2.
See M3.rot3_map.
See M3.rot3_axis.
See M3.rot3_zyx.
rigid3 move rot is the rigid body transformation of 3D space that rotates by the axis/radian angle rot and then translates by move.
rigid3q move rot is the rigid body transformation of 3D space that rotates by the quaternion rot and then translates by move.
srigid3 scale move rot scale is like rigid3 but starts by scaling according to scale.
srigid3q move rot scale is like rigid3q but starts by scaling according to scale.
Projection matrices assume a right-handed coordinate system with the eye at the origin looking down the z-axis.
val ortho :
left:float ->
right:float ->
bot:float ->
top:float ->
near:float ->
far:float ->
m4ortho left right bot top near far maps the axis aligned box with corners (left, bot, -near) and (right, top, -far) to the axis aligned cube with corner (-1, -1, -1) and (1, 1, 1).
val persp :
left:float ->
right:float ->
bot:float ->
top:float ->
near:float ->
far:float ->
m4persp left right bot top near far maps the frustum with top of the underlying pyramid at the origin, near clip rectangle corners (left, bot, -near), (right, top, -near) and far plane at -far to the axis aligned cube with corners (-1, -1, -1) and (1,1,1).
mapi f a is like map but the element indices are also given.
val fold : ('a -> float -> 'a) -> 'a -> m4 -> 'afold f acc a is f (...(f (f acc a00) a10)...).
val foldi : ('a -> int -> int -> float -> 'a) -> 'a -> m4 -> 'afoldi f acc a is f (...(f (f acc 0 0 a00) 1 0 a10)...).
val iter : (float -> unit) -> m4 -> unititer f a is f a00; f a10; ...
val iteri : (int -> int -> float -> unit) -> m4 -> unititeri f a is f 0 0 a00; f 1 0 a10; ...
val for_all : (float -> bool) -> m4 -> boolfor_all p a is p a00 && p a10 && ...
val exists : (float -> bool) -> m4 -> 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 -> m4 -> unitpp ppf a prints a textual representation of a on ppf.
val pp_f :
(Stdlib.Format.formatter -> float -> unit) ->
Stdlib.Format.formatter ->
m4 ->
unitpp_f pp_e ppf a prints a like pp but uses pp_e to print floating point values.
val e00 : m4 -> floatval e01 : m4 -> floatval e02 : m4 -> floatval e03 : m4 -> floatval e10 : m4 -> floatval e11 : m4 -> floatval e12 : m4 -> floatval e13 : m4 -> floatval e20 : m4 -> floatval e21 : m4 -> floatval e22 : m4 -> floatval e23 : m4 -> floatval e30 : m4 -> floatval e31 : m4 -> floatval e32 : m4 -> floatval e33 : m4 -> float