module V3:sig..end
typet =Gg.v3
val dim : int
typem =Gg.m3
val v : float -> float -> float -> Gg.v3v x y z is the vector (x y z).val comp : int -> Gg.v3 -> float
val x : Gg.v3 -> floatx v is the x component of v.val y : Gg.v3 -> floaty v is the y component of v.val z : Gg.v3 -> floatz v is the z component of v.val ox : Gg.v3ox is the unit vector (1. 0. 0.).val oy : Gg.v3oy is the unit vector (0. 1. 0.).val oz : Gg.v3oz is the unit vector (0. 0. 1.).val zero : Gg.v3
val infinity : Gg.v3infinity is the vector whose components are infinity.val neg_infinity : Gg.v3neg_infinity is the vector whose components are neg_infinity.val basis : int -> Gg.v3basis i is the ith vector of an
orthonormal basis
of the vector space Gg.V3.t with inner product Gg.V3.dot.Invalid_argument if i is not in [0;Gg.V3.dim[.val of_tuple : float * float * float -> Gg.v3of_tuple (x, y, z) is v x y z.val to_tuple : Gg.v3 -> float * float * floatto_tuple v is (x v, y v, z v).val of_spherical : Gg.v3 -> Gg.v3of_spherical sv is the vector whose cartesian coordinates
(x, y, z) correspond to the radial, azimuth
angle and zenith angle
spherical
coordinates (r, theta, phi) given by (V3.x sv, V2.y sv, V3.z sv).val to_spherical : Gg.v3 -> Gg.v3to_spherical v is the vector whose coordinate (r, theta,
phi) are the radial, azimuth angle and zenith angle
spherical
coordinates of v. theta is in [-pi;pi] and phi in
[0;pi].val of_v2 : Gg.v2 -> z:float -> Gg.v3of_v2 u z is v (V2.x u) (V2.y u) z.val of_v4 : Gg.v4 -> Gg.v3of_v4 u z is v (V4.x u) (V4.y u) (V4.z u).val neg : Gg.v3 -> Gg.v3neg v is the inverse vector -v.val add : Gg.v3 -> Gg.v3 -> Gg.v3add u v is the vector addition u + v.val sub : Gg.v3 -> Gg.v3 -> Gg.v3sub u v is the vector subtraction u - v.val mul : Gg.v3 -> Gg.v3 -> Gg.v3mul u v is the component wise multiplication u * v.val div : Gg.v3 -> Gg.v3 -> Gg.v3div u v is the component wise division u / v.val smul : float -> Gg.v3 -> Gg.v3smul s v is the scalar multiplication sv.val half : Gg.v3 -> Gg.v3half v is the half vector smul 0.5 v.val cross : Gg.v3 -> Gg.v3 -> Gg.v3
val dot : Gg.v3 -> Gg.v3 -> float
val norm : Gg.v3 -> floatnorm v is the norm |v| = sqrt v.v.val norm2 : Gg.v3 -> floatnorm2 v is the squared norm |v|2 .val unit : Gg.v3 -> Gg.v3unit v is the unit vector v/|v|.val spherical : float -> float -> float -> Gg.v3spherical r theta phi is of_spherical (V3.v r theta phi).val azimuth : Gg.v3 -> float
val zenith : Gg.v3 -> float
val homogene : Gg.v3 -> Gg.v3homogene v is the vector v/vz if vz <> 0 and
v otherwise.val mix : Gg.v3 -> Gg.v3 -> float -> Gg.v3mix u v t is the linear interpolation u + t(v - u).val ltr : Gg.m3 -> Gg.v3 -> Gg.v3
val tr : Gg.m4 -> Gg.v3 -> Gg.v3tr m v is the
affine
transform in
homogenous 3D space of the vector v by m.
Note. Since m is supposed to be affine the function
ignores the last row of m. v is treated as a vector
(infinite point, its last coordinate in homogenous space is 0)
and is thus translationally invariant. Use Gg.P3.tr to
transform finite points.
Pervasives operatorsval (+) : Gg.v3 -> Gg.v3 -> Gg.v3u + v is add u v.val (-) : Gg.v3 -> Gg.v3 -> Gg.v3u - v is sub u v.val ( * ) : float -> Gg.v3 -> Gg.v3t * v is smul t v.val (/) : Gg.v3 -> float -> Gg.v3v / t is smul (1. /. t) v.val map : (float -> float) -> Gg.v3 -> Gg.v3map f v is the component wise application of f to v.val mapi : (int -> float -> float) -> Gg.v3 -> Gg.v3
val fold : ('a -> float -> 'a) -> 'a -> Gg.v3 -> 'afold f acc v is f (...(f (f acc v0) v1)...).val foldi : ('a -> int -> float -> 'a) -> 'a -> Gg.v3 -> 'afoldi f acc v is f (...(f (f acc 0 v0) 1 v1)...).val iter : (float -> unit) -> Gg.v3 -> unititer f v is f v0; f v1; ...val iteri : (int -> float -> unit) -> Gg.v3 -> unititeri f v is f 0 v0; f 1 v1; ...val for_all : (float -> bool) -> Gg.v3 -> boolfor_all p v is p v0 && p v1 && ...val exists : (float -> bool) -> Gg.v3 -> boolexists p v is p v0 || p v1 || ...val equal : Gg.v3 -> Gg.v3 -> boolequal u v is u = v.val equal_f : (float -> float -> bool) -> Gg.v3 -> Gg.v3 -> bool
val compare : Gg.v3 -> Gg.v3 -> intcompare u v is Pervasives.compare u v.val compare_f : (float -> float -> int) -> Gg.v3 -> Gg.v3 -> intcompare_f cmp u v compares u and v like Gg.V3.compare
but uses cmp to compare floating point values.val to_string : Gg.v3 -> stringto_string v is a textual representation of v.val pp : Format.formatter -> Gg.v3 -> unitpp ppf v prints a textual representation of v on ppf.val pp_f : (Format.formatter -> float -> unit) -> Format.formatter -> Gg.v3 -> unit