Graphv_webgl.MatrixA 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 m1
m2 m3
m4 m5
val create : unit -> 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 scale : t -> xs:float -> ys:float -> unitval rotate : t -> angle:float -> unitval identity : t -> unitval skew_x : t -> angle:float -> unitval skew_y : t -> angle:float -> unitval to_3x4 : t -> float arrayReturns an array:
m0 m1 0 0
m2 m3 0 0
m4 m5 1 0
val is_flipped : t -> boolm0*m3 - m2*m1 < 0
val print : t -> unit