Module AGeom.Vector2d

module Vector2d: sig .. end

type t = AGeom.vector2d 
(x, y)
val of_points : AGeom.Point2d.t -> AGeom.Point2d.t -> t
Vector2d.of_points a b returns the vector ab from a to b.
val add : t -> t -> t
a + b
val sub : t -> t -> t
a - b
val mul : t -> float -> t
v * k
val div : t -> float -> t
v / k
val dot : t -> t -> float
Dot product of two vectors
val length : t -> float
Returns the length (magnitude) of this vector.
val normalise : t -> t
Normalises this vector
val angle : t -> AGeom.Angle.t
Returns the angle of this vector.
val cross : t -> t -> float
cross-product
val rot90 : t -> t
rotates by 90 degrees
val rot90neg : t -> t
rotates by minus 90 degrees
val get_line_intersection : seg1:t * t ->
seg2:t * t -> t option
Returns the point where the lines intersect if any intersection, None otherwise.
val rand : float * float -> t
return a random 2D vector
val srand : Random.State.t -> float * float -> t
val to_string : t -> string
val of_string : string -> t
module Infix: sig .. end