V1.Vector
Vector manipulation functions
type t = float * float
A vector is a pair of floats of the form (x, y)
val zero : t
zero is the zero/null vector
zero
val unit : t
unit is the unit vector
unit
val add : t -> t -> t
add v1 v2 returns the sum of vectors v1 and v2
add v1 v2
v1
val sub : t -> t -> t
sub v1 v2 returns the difference of vectors v1 and v2
sub v1 v2
v2
val mul : t -> float -> t
mul v k returns the product of vector v by the scalar k
mul v k
v
k
val dot : t -> t -> float
dot v1 v2 returns the dot product of vectors v1 and v2
dot v1 v2
val norm : t -> float
norm v computes the norm of vector v
norm v