mlpost
OCaml library on top of Metapost
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type t = Signature.point
The abstract type for points
The following functions create points of length 1. They are especially useful to specify directions with Path.Vec
val dir : float -> t
dir f
is the point at angle f
on the unit circle. f
shall be given in degrees
The unitary vectors pointing up, down, left and right
val up : t
val down : t
val left : t
val right : t
val origin : t
Operations on points
val transform : Transform.t -> t -> t
Apply a transformation to a point
segment f p1 p2
is the point (1-f)p1 + fp2
. Stated otherwise, if p1
is at 0.
and p2
is at 1.
, return the point that lies at f
rotate_around p1 f p2
rotates p2
around p1
by an angle f
in degrees
Convenient constructors
The following functions build a point at a given scale (see Num.t
for scales)
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
Same as the previous functions but build list of points
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
Same as p
, but builds a list of points