Raised when an error occurs (usually a division by zero)
Module OgamlMath.Vector2fs
Operations on immutable vectors of 2 floats represented in polar coordinatesThis module defines the vector2fs type and various operations on it.
Vector operations
Type of immutable vectors of 2 floats represented in polar coordinates
Record fields
Signed radius | |
Theta angle. An angle of 0 corresponds to a vector pointing towards positive X. |
Zero vector
Unit x vector
Unit y vector
Multiplies a vector by a scalar
Divides a vector by a scalar. Raises Vector2fs_exception if the scalar is zero.
Converts a vector represented in polar coordinates to a vector represented in cartesian coordinates
See : OgamlMath.Vector2f
See : OgamlMath.Vector2f
Converts a vector represented in cartesian coordinates to a vector represented in polar coordinates
See : OgamlMath.Vector2f
See : OgamlMath.Vector2f
Computes the norm of a vector
Normalizes a vector. Raises Vector2fs_exception if the vector is zero.
Returns a pretty-printed string (not for serialization)