Zinggi/elm-webgl-math/1.0.5

NOTE: this package is not compatible with Elm 0.19.1

Matrix3

This will have some more functions soon. Currently it's missing 2D transformation functions.

type alias Mat3 a =
( Vec3 a, Vec3 a, Vec3 a )
type alias Float3x3 =
Mat3 Float
map : (a -> b) -> Mat3 a -> Mat3 b
map2 : (a -> b -> c) -> Mat3 a -> Mat3 b -> Mat3 c
identity : Float3x3

The identity matrix

I = |1 0 0|
    |0 1 0|
    |0 0 1|
add : Float3x3 -> Float3x3 -> Float3x3

A + B

sub : Float3x3 -> Float3x3 -> Float3x3

A - B

mul : Float3x3 -> Float3x3 -> Float3x3

A*B

mulVector : Float3x3 -> Float3 -> Float3

A*v

transpose : Float3x3 -> Float3x3

A^T

elementWiseMul : Float3x3 -> Float3x3 -> Float3x3

A .* B

transform : Float3x3 -> Float2 -> Float2
|v'| = A*|v|  v'/w
|w |     |1|,