module Num: sig
.. end
The Mlpost Num module
Numerics are intended to be lengths in some unit. In addition, values of
type Num.t
may actually be unknown to Mlpost. This is why there is no
function that gives back a float
.
type
t
The Mlpost numeric type is an abstract datatype
Conversion functions
The base unit in Mlpost are bp. The following functions
permit to specify values in other common units
val bp : float -> t
val pt : float -> t
pt are PostScript points. This is the same unit as the pt unit in Latex
val cm : float -> t
val mm : float -> t
val inch : float -> t
val addn : t -> t -> t
Useful operations on Nums
val subn : t -> t -> t
val multn : t -> t -> t
val multf : float -> t -> t
val divf : t -> float -> t
val neg : t -> t
val divn : t -> t -> t
val maxn : t -> t -> t
val minn : t -> t -> t
val gmean : t -> t -> t
the geometric mean of two nums : sqrt(a * a + b * b)
Infix operators
module Infix: sig
.. end
Useful constants and functions
val zero : t
val one : t
val two : t
Shortcuts for bp 0.
, bp 1.
and bp 2.
.
val pi : float
3 .14159
val deg2rad : float -> float
Converts degrees into radians
type
scale = float -> t
module Scale: sig
.. end