Gg.V44D vectors.
type t = v4The type for 4D vectors.
dim is the dimension of vectors of type v4.
type m = m4The type for matrices representing linear transformations of 4D space.
val v : float -> float -> float -> float -> v4v x y z w is the vector (x y z w).
val comp : int -> v4 -> floatcomp i v is vi, the ith component of v.
Raises Invalid_argument if i is not in [0;dim[.
val x : v4 -> floatx v is the x component of v.
val y : v4 -> floaty v is the y component of v.
val z : v4 -> floatz v is the z component of v.
val w : v4 -> floatz v is the z component of v.
val ox : v4ox is the unit vector (1. 0. 0. 0.).
val oy : v4oy is the unit vector (0. 1. 0. 0.).
val oz : v4oz is the unit vector (0. 0. 1. 0.).
val ow : v4ow is the unit vector (0. 0. 0. 1.).
val infinity : v4infinity is the vector whose components are infinity.
val neg_infinity : v4neg_infinity is the vector whose components are neg_infinity.
val basis : int -> v4basis i is the ith vector of an orthonormal basis of the vector space t with inner product dot.
Raises Invalid_argument if i is not in [0;dim[.
val of_tuple : (float * float * float * float) -> v4of_tuple (x, y, z, w) is v x y z w.
val to_tuple : v4 -> float * float * float * floatto_tuple v is (x v, y v, z v, w v).
dot u v is the dot product u.v.
val norm : v4 -> floatnorm v is the norm |v| = sqrt v.v.
val norm2 : v4 -> floatnorm2 v is the squared norm |v|2 .
ltr m v is the linear transform mv.
Stdlib operatorsmapi f v is like map but the component index is also given.
val fold : ('a -> float -> 'a) -> 'a -> v4 -> 'afold f acc v is f (...(f (f acc v0) v1)...).
val foldi : ('a -> int -> float -> 'a) -> 'a -> v4 -> 'afoldi f acc v is f (...(f (f acc 0 v0) 1 v1)...).
val iter : (float -> unit) -> v4 -> unititer f v is f v0; f v1; ...
val iteri : (int -> float -> unit) -> v4 -> unititeri f v is f 0 v0; f 1 v1; ...
val for_all : (float -> bool) -> v4 -> boolfor_all p v is p v0 && p v1 && ...
val exists : (float -> bool) -> v4 -> boolexists p v is p v0 || p v1 || ...
equal_f eq u v tests u and v like equal but uses eq to test floating point values.
compare_f cmp u v compares u and v like compare but uses cmp to compare floating point values.
val pp : Stdlib.Format.formatter -> v4 -> unitpp ppf v prints a textual representation of v on ppf.