Page
Library
Module
Module type
Parameter
Class
Class type
Source
Gg.V3Source3D vectors.
The type for matrices representing linear transformations of 3D space.
comp i v is vi, the ith component of v.
Raises Invalid_argument if i is not in [0;dim[.
basis 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[.
of_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).
to_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].
cross u v is the cross product u x v.
dot u v is the dot product u.v.
spherical r theta phi is of_spherical (V3.v r theta phi).
azimuth v is the azimuth angle spherical coordinates of v. The result is in [-pi;pi].
zenith v is the zenith angle spherical coordinates of v. The result is in [0;pi].
ltr m v is the linear transform mv.
tr 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 P3.tr to transform finite points.
Stdlib operatorsmapi f v is like map but the component index is also given.
foldi f acc v is f (...(f (f acc 0 v0) 1 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.
pp ppf v prints a textual representation of v on ppf.
pp_f pp_comp ppf v prints v like pp but uses pp_comp to print floating point values.