Raised when an error occurs (usually a division by zero)
Module OgamlMath.Vector3fs
Operations on immutable vectors of 3 floats represented in spherical coordinatesThis module defines the vector3fs type and various operations on it.
Vector operations
Type of immutable vectors of 3 floats represented in spherical coordinates
Record fields
Signed radius | |
Longitude (theta). A longitude of 0 corresponds to a vector pointing towards positive Z. | |
Latitude (phi). A latitude of 0 corresponds to a vector pointing towards the equator, and a latitude of pi/2 corresponds to a vector pointing towards the north pole (positive Y). |
Zero vector
Unit x vector
Unit y vector
Unit z vector
Multiplies a vector by a scalar
Divides a vector by a scalar. Raises Vector3fs_exception if the scalar is zero.
Converts a vector represented in spherical coordinates to a vector represented in cartesian coordinates
See : OgamlMath.Vector3f
See : OgamlMath.Vector3f
Converts a vector represented in cartesian coordinates to a vector represented in spherical coordinates
See : OgamlMath.Vector3f
See : OgamlMath.Vector3f
Computes the norm of a vector
Normalizes a vector. Raises Vector3fs_exception if the vector is zero.
Returns a pretty-printed string (not for serialization)