exception Vector3i_exception of string
Raised when an error occurs (usually a division by zero)
This module defines the vector3i type and various operations on it.
exception Vector3i_exception of string
type t = {x : int; y : int; z : int}
x : int
|
|
y : int
|
|
z : int
|
val make : int -> int -> int -> t
val zero : t
val unit_x : t
val unit_y : t
val unit_z : t
val add : t -> t -> t
val sub : t -> t -> t
sub u v
computes the vector u - v
val prop : int -> t -> t
val div : int -> t -> t
val pointwise_product : t -> t -> t
val pointwise_div : t -> t -> t
val project : t -> Vector2i.t
val lift : Vector2i.t -> t
val dot : t -> t -> int
val cross : t -> t -> t
val angle : t -> t -> float
val squared_norm : t -> int
val norm : t -> float
val squared_dist : t -> t -> int
val dist : t -> t -> float
val clamp : t -> t -> t -> t
clamp v a b
returns the vector whose coordinates are the coordinates of v
clamped between the coordinates of a
and b
val map : t -> (int -> int) -> t
val map2 : t -> t -> (int -> int -> int) -> t
val max : t -> int
val min : t -> int
val raster : t -> t -> t list
raster p1 p2
applies the Bresenham's line algorithm between the pointsp1
and p2
and returns the list of points constituting the line val print : t -> string