webgl_fundamentals_m3 library

Functions

degToRad(num d) num
distance(num x1, num y1, num x2, num y2) num
dot(num x1, num y1, num x2, num y2) num
identity() List<int>
Creates a 3x3 identity matrix
inverse(List<num> m) List<num>
multiply(List<num> a, List<num> b) List<num>
Takes two Matrix3s, a and b, and computes the product in the order that pre-composes b with a. In other words, the matrix returned will a A matrix. b A matrix.
normalize(num x, num y) List<num>
project(List<num> m, num width, num height) List<num>
Multiplies by a 2D projection matrix m the matrix to be multiplied width width in pixels height height in pixels
projection(num width, num height) List<num>
Creates a 2D projection matrix width width in pixels height height in pixels
radToDeg(num r) num
reflect(num ix, num iy, num nx, num ny) List<num>
rotate(List<num> m, num angleInRadians) List<num>
Multiplies by a 2D rotation matrix m the matrix to be multiplied angleInRadians amount to rotate in radians
rotation(num angleInRadians) List<num>
Creates a 2D rotation matrix angleInRadians amount to rotate in radians
scale(List<num> m, num sx, num sy) List<num>
Multiplies by a 2D scaling matrix m the matrix to be multiplied sx amount to scale in x sy amount to scale in y
scaling(num sx, num sy) List<num>
Creates a 2D scaling matrix sx amount to scale in x sy amount to scale in y
transformPoint(List<num> m, List<num> v) List<num>
translate(List<num> m, num tx, num ty) List<num>
Multiplies by a 2D translation matrix m the matrix to be multiplied tx amount to translate in x ty amount to translate in y
translation(num tx, num ty) List<num>
Creates a 2D translation matrix tx amount to translate in x ty amount to translate in y