---
title: "translateX(by:yBy:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsaffinetransform/translatex(by:yby:)"
---

# translateX(by:yBy:)

Applies the specified translation factors to the receiver’s transformation matrix.

## Declaration

```swift
func translateX(by deltaX: Double, yBy deltaY: Double)
```

## Parameters

- `deltaX`: The number of units to move along the x axis.
- `deltaY`: The number of units to move along the y axis.

## Discussion

Discussion Subsequent transformations cause coordinates to be shifted by deltaX units along the x axis and by deltaY units along the y axis. Translation factors do not affect NSSize values, which specify a differential between points.

## See Also

### Accumulating Transformations

- [rotate(byDegrees:)](foundation/nsaffinetransform/rotate(bydegrees:).md)
- [rotate(byRadians:)](foundation/nsaffinetransform/rotate(byradians:).md)
- [scale(by:)](foundation/nsaffinetransform/scale(by:).md)
- [scaleX(by:yBy:)](foundation/nsaffinetransform/scalex(by:yby:).md)
- [append(_:)](foundation/nsaffinetransform/append(_:).md)
- [prepend(_:)](foundation/nsaffinetransform/prepend(_:).md)
- [invert()](foundation/nsaffinetransform/invert().md)
