identity_matrix, zero_vec, new_identity_matrix, new_zero_vec, make_identity_matrix, make_zero_vec - identity matrix and zero vector |
#include <matvec.h> float identity_matrix[16]; float zero_vec[4]; float *new_identity_matrix (pool); float *new_zero_vec (pool); #define make_identity_matrix(m) memcpy (m, identity_matrix, sizeof(float)*16); #define make_zero_vec(v) memcpy (v, zero_vec, sizeof (float) * 4); |
The identity_matrix variable contains a read-only copy of the identity matrix. The zero_vec variable contains a read-only copy of the zero vector. |
Use new_identity_matrix to allocate a new identity matrix variable in pool. Use new_zero_vec to similarly allocate a new zero vector. |
Use make_identity_matrix to copy the identity matrix over an existing matrix m. Use make_zero_vec to similarly copy the zero vector over an existing vector v. |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
c2lib-1.2.13 |
new_matrix(3), new_vec(3). |