package wall

  1. Overview
  2. Docs

Definition of affine transformation matrices.

type t = Wall_types.transform = {
  1. x00 : float;
  2. x01 : float;
  3. x10 : float;
  4. x11 : float;
  5. x20 : float;
  6. x21 : float;
}
val identity : t
val average_scale : t -> float
val scale_x : t -> float
val scale_y : t -> float
val translation : x:float -> y:float -> t
val rotation : a:float -> t
val scale : sx:float -> sy:float -> t
val skew : sx:float -> sy:float -> t
val compose : t -> t -> t
val inverse : t -> t
val translate : x:float -> y:float -> t -> t
val rotate : float -> t -> t
val rescale : sx:float -> sy:float -> t -> t
val px : t -> float -> float -> float

px t x y is the x coordinate of the point (x,y) after applying the affine transformation t.

val py : t -> float -> float -> float

py t x y is the y coordinate of the point (x,y) after applying the affine transformation t.

val linear_px : t -> float -> float -> float

linear_px t x y is the x coordinate of the point (x,y) after applying the linear transformation described by t. Translation is ignored!

val linear_py : t -> float -> float -> float

linear_py t x y is the y coordinate of the point (x,y) after applying the linear transformation described by t. Translation is ignored!

val point : t -> Gg.p2 -> Gg.p2

point t p is the point p after transformation by t

OCaml

Innovation. Community. Security.