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

### NAME

    scale() - apply a scale transform to a matrix

### SYNOPSIS

    float array scale( float array matrix, float x, float y, float z );

### DESCRIPTION

    Applies scale factors x, y, and z to matrix and returns matrix.  The
    argument must be a 16 element float array in the format returned by
    id_matrix().

    This efun modifies the supplied matrix array in place.  Internally, the
    driver creates a scaling matrix and multiplies the current matrix by that
    scaling matrix.

### EXAMPLE

    float array m = id_matrix();

    m = scale(m, 2.0, 2.0, 1.0);

### SEE ALSO

    id_matrix(3), translate(3), rotate_x(3), rotate_y(3), rotate_z(3)
