Game Maker Games, Articles, Tutorials & More

Game Maker Network


Howdy, Guest! Please sign in or register an account.

Print

matrix_identity

By Daniel · January 1, 2009

Returns an identity matrix with the given dimension

/* matrix_identity(dimension)
 *
 * Returns an identity matrix with the given dimension.
 */

var I, c;

I = ds_grid_create(argument0, argument0);

for (c = 0; c < argument0; c += 1)
  ds_grid_set(I, c, c, 1);

return I;

Categories: Mathematics

Comments

There are no comments to display.

Post a Comment

You must be signed in to post comments.

Advertisement