Module Graphv_gles2_native.Matrix
A module for basic 2x2 (+2) matrix operations.
type t={mutable m0 : float;cos a, scalex
mutable m1 : float;sin a, shearx
mutable m2 : float;-sin a, sheary
mutable m3 : float;cos a, scaley
mutable m4 : float;translatex
mutable m5 : float;translatey
}A 2x2 transform matrix with 2 more values for translation.
m0 m1m2 m3m4 m5
val create : unit -> tval copy : t -> tval zero : t -> unitval translate : t -> x:float -> y:float -> unitval get_average_scale : t -> floatThe formula is:
sx = sqrt(m0*m0 + m2*m2)sy = sqrt(m1*m1 + m3*m3)(sx + sy) * 0.5
val transform_point : t -> float -> float -> float * floatval premultiply : dst:t -> src:t -> unitReversed multiplication:
dst = src*dst
val scale : t -> xs:float -> ys:float -> unitval inverse : dst:t -> src:t -> unitval rotate : t -> angle:float -> unit- parameter angle
Angle in radians.
val skew_y : t -> angle:float -> unit- parameter angle
Angle in radians.
val to_3x4 : t -> float arrayReturns an array:
m0 m1 0 0m2 m3 0 0m4 m5 1 0
val is_flipped : t -> boolm0*m3 - m2*m1 < 0
val print : t -> unit