---
title: translate
framework: webkitjs
role: symbol
role_heading: Instance Method
path: webkitjs/canvasrenderingcontext2d/1629441-translate
---

# translate

Moves the origin of the canvas coordinate system.

## Declaration

```data
void translate(
    unrestricted float tx, 
    unrestricted float ty
);
```

## Parameters

- `tx`: The x-coordinate in the current canvas coordinate system to be made the new origin.
- `ty`: The y-coordinate in the current canvas coordinate system to be made the new origin.

## Discussion

Discussion The specified point x,y in the canvas coordinate system becomes the point 0,0 and the entire coordinate system is translated accordingly.

## See Also

### Changing the Coordinate System

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