Module Gg.Size2

module Size2: sig .. end


In 2D space, width is the extent along the x-axis and height the extent along the y-axis.


type t = Gg.size2 
The type for 2D sizes.
val dim : int
dim is the dimension of sizes of type Gg.size2.

Constructors, accessors and constants


val v : float -> float -> Gg.size2
v w h is a size of width w and height h.
val w : Gg.size2 -> float
w s is the width of s.
val h : Gg.size2 -> float
h s is the height of s.
val zero : Gg.size2
zero is the zero size, zero width and height.
val unit : Gg.size2
unit is the unit size, one width and height.

Functions


val aspect : Gg.size2 -> float
aspect s is w s /. h s.
val of_w : float -> aspect:float -> Gg.size2
of_w w aspect is v w (w /. aspect).
val of_h : float -> aspect:float -> Gg.size2
of_h h aspect is v (h *. aspect) h.