---
layout: doc
title: general / id_matrix
---
# id_matrix

### NAME

    id_matrix() - return a 4 by 4 identity matrix

### SYNOPSIS

    float array id_matrix();

### DESCRIPTION

    Returns a new 16 element float array containing an identity matrix.
    The matrix is stored in row-major order:

        ({
            1.0, 0.0, 0.0, 0.0,
            0.0, 1.0, 0.0, 0.0,
            0.0, 0.0, 1.0, 0.0,
            0.0, 0.0, 0.0, 1.0
        })

    The matrix efuns use this 16 float array representation for translation,
    scaling, rotation, and look-at transforms.

### SEE ALSO

    translate(3), scale(3), rotate_x(3), rotate_y(3), rotate_z(3),
    lookat_rotate(3), lookat_rotate2(3)
