package archimedes

  1. Overview
  2. Docs

Transformations that are the composition of translations and inhomogeneous dilations (different scaling factors are allowed in each canonical direction).

type t

See Matrix.t, setting xy = 0 = yx.

val of_matrix : affine -> t

of_matrix m returns a copy of the transformation m if it contains no rotation or raise Invalid_argument otherwise.

val to_matrix : t -> affine

to_matrix m returns a copy of the transformation m.

val make_identity : unit -> t
val make_translate : x:float -> y:float -> t
val make_scale : x:float -> y:float -> t
val set_to_identity : t -> unit
val copy : t -> t
val blit : t -> t -> unit
val translate : t -> x:float -> y:float -> unit
val scale : t -> x:float -> y:float -> unit
val invert : t -> unit
val det : t -> float
val mul : t -> t -> t
val mul_in : t -> t -> t -> unit
val transform_point : t -> x:float -> y:float -> float * float
val transform_distance : t -> dx:float -> dy:float -> float * float
val inv_transform_point : t -> x:float -> y:float -> float * float
val inv_transform_distance : t -> dx:float -> dy:float -> float * float
val transform_rectangle : ?dist_basepoint:bool -> t -> rectangle -> rectangle
OCaml

Innovation. Community. Security.