---
title: transform
framework: webkitjs
role: symbol
role_heading: Instance Method
path: webkitjs/canvasrenderingcontext2d/1629911-transform
---

# transform

Transforms the current transformation matrix using another matrix.

## Declaration

```data
void transform(
    unrestricted float m11, 
    unrestricted float m12, 
    unrestricted float m21, 
    unrestricted float m22, 
    unrestricted float dx, 
    unrestricted float dy
);
```

## Parameters

- `m11`: Column 1 row 1 matrix value (a).
- `m12`: Column 1 row 2 matrix value (b).
- `m21`: Column 2 row 1 matrix value (c).
- `m22`: Column 2 row 2 matrix value (d).
- `dx`: X scalar (e).
- `dy`: Y Scalar (f).

## Discussion

Discussion This method replaces the current transformation matrix with the result of a matrix multiplication between the current transformation matrix and the specified transformation matrix shown in Figure 1.

## See Also

### Changing the Coordinate System

- [rotate](webkitjs/canvasrenderingcontext2d/1630553-rotate.md)
- [scale](webkitjs/canvasrenderingcontext2d/1631799-scale.md)
- [setTransform](webkitjs/canvasrenderingcontext2d/1630015-settransform.md)
- [translate](webkitjs/canvasrenderingcontext2d/1629441-translate.md)
