math

Types

Matrix[Rows; Cols; T] = array[Rows, array[Cols, T]]
Matrix alias type
Vector[Cols; T] = array[Cols, T]
Vector alias type

Procs

proc `[]`[Rows, Cols: static[int]; T](self: Matrix[Rows, Cols, T]; x, y: int): T {...}{.inline.}
Single bracket access to an x/y coordinate
proc `*`[N, M, P: static[int]; T: SomeNumber](a: Matrix[N, M, T]; b: Matrix[M, P, T]): Matrix[
    N, P, T]
Multiplies two matrices
proc `*`[N, M: static[int]; T: SomeNumber](a: Vector[N, T]; b: Matrix[N, M, T]): Vector[M, T]
Multiplies a vector by a matrix
proc identity[N: static[int]; T: SomeNumber](matrix: var Matrix[N, N, T])
Sets a matrix back to an identity matrix
proc newIdentity[N: static[int]; T: SomeNumber](): Matrix[N, N, T]
Instantiates a new identity matrix