Module Mlpost.Point
Points in the plane
type t
= Signature.point
The abstract type for points
val dir : float -> t
dir f
is the point at anglef
on the unit circle.f
shall be given in degrees
val up : t
val down : t
val left : t
val right : t
val origin : t
val length : t -> Num.t
length p
is the length of vector from the origin top
Operations on points
val transform : Transform.t -> t -> t
Apply a transformation to a point
val segment : float -> t -> t -> t
segment f p1 p2
is the point(1-f)p1 + fp2
. Stated otherwise, ifp1
is at0.
andp2
is at1.
, return the point that lies atf
Convenient constructors
val bpp : (float * float) -> t
val inp : (float * float) -> t
val cmp : (float * float) -> t
val mmp : (float * float) -> t
val ptp : (float * float) -> t
val map_bp : (float * float) list -> t list
val map_in : (float * float) list -> t list
val map_cm : (float * float) list -> t list
val map_mm : (float * float) list -> t list
val map_pt : (float * float) list -> t list
val p : ?scale:(float -> Num.t) -> (float * float) -> t
Builds a point from a pair of floats
- parameter scale
a scaling function to be applied to each float; see
Num.t
for scaling functions for usual units