jjant/linear-algebra/1.0.0

Mat2

type alias Mat2 =
{ m11 : Float
, m12 : Float
, m21 : Float
, m22 : Float
}

Create

identity : Mat2
fromRows : Vec2 -> Vec2 -> Mat2

Create a matrix out of vectors representing its rows.

Operations

add : Mat2 -> Mat2 -> Mat2
mul : Mat2 -> Mat2 -> Mat2
invert : Mat2 -> Maybe Mat2
transpose : Mat2 -> Mat2
det : Mat2 -> Float

Transformations

rotate : Float -> Mat2
scale : Vec2 -> Mat2

Apply matrices

transform : Mat2 -> Vec2 -> Vec2