Skip to contents

Returns a 2x3 affine transformation matrix that translates by (dx, dy) pixels. To compose transforms, embed into a 3x3 matrix with rbind(m, c(0, 0, 1)) before multiplying with %*%.

Usage

affine_translate(dx, dy)

Arguments

dx

Numeric. Horizontal shift in pixels (positive = rightward).

dy

Numeric. Vertical shift in pixels (positive = downward).

Value

A 2x3 numeric matrix.