# Module OgamlMath.Vector3i

Operations on immutable vectors of 3 ints

This module defines the vector3i type and various operations on it.

Raised when an error occurs (usually a division by zero)

### Vector operations

Type of immutable vectors of 3 ints

#### Record fields

 `x : int` `y : int` `z : int`
Fast way to create a vector
Zero vector
Unit x vector
Unit y vector
Unit z vector
`sub u v` computes the vector `u - v`
Multiplies a vector by a scalar
Divides a vector by a scalar. Raises Vector3i_exception if the scalar is zero.
Computes the pointwise product of two vectors.
Computes the pointwise division of two vectors.
Projects a vector on the plane `z = 0`
See : OgamlMath.Vector2i
Lifts a 2D vector in the 3D space by setting `z = 0`
See : OgamlMath.Vector2i
Computes the dot product of two vectors
Computes the cross product of two vectors
Computes the angle (in radians) between two vectors
Computes the squared norm of a vector
Computes the norm of a vector
Computes the squared distance between two points
Computes the distance between two points
`clamp v a b` returns the vector whose coordinates are the coordinates of `v` clamped between the coordinates of `a` and `b`
Maps each coordinate of a vector
Maps each pair of coordinates of two vectors
Returns the maximal coordinate of a vector
Returns the minimal coordinate of a vector
`raster p1 p2` applies the Bresenham's line algorithm between the points`p1` and `p2` and returns the list of points constituting the line
Note : should not be used for precise raytracing as it may miss points
Returns a pretty-printed string (not for serialization)