module P2:sig
..end
typet =
Gg.p2
val dim : int
typemh =
Gg.m3
val v : float -> float -> Gg.p2
v x y
is the point (x y)
.val x : Gg.p2 -> float
x p
is the x coordinate of p
.val y : Gg.p2 -> float
y p
is the y coordinate of p
.val o : Gg.p2
o
is the point (0 0)
.val mid : Gg.p2 -> Gg.p2 -> Gg.p2
mid p q
is the mid point (p + q)/2
.val tr : Gg.m3 -> Gg.p2 -> Gg.p2
tr m p
is the
affine
transform in
homogenous 2D space of the point p
by m
.
Note. Since m
is supposed to be affine the function
ignores the last row of m
. p
is treated as a finite point
(its last coordinate in homogenous space is 1). Use Gg.V2.tr
to transform vectors (infinite points).