TrajRotate: Rotate a trajectory

View source: R/trajectory.R

TrajRotateR Documentation

Rotate a trajectory

Description

Rotates a trajectory by angle (when relative is FALSE), or so that angle(finish - start) == angle (when relative is TRUE).

Usage

TrajRotate(trj, angle = 0, origin = c(0, 0), relative = TRUE)

Arguments

trj

The trajectory to be rotated.

angle

The angle of rotation in radians. Either the first and last points in the rotated trajectory (when relative = TRUE), or else the angle be rotated (when relative = FALSE).

origin

Trajectory is rotated about this point.

relative

If TRUE, angle is the angle (after rotation) from the start to the end point of the trajectory. If FALSE, the trajectory is rotated about its start point by angle. You probably want to use relative = TRUE.

Value

A new trajectory which is a rotated version of the input trajectory.


trajr documentation built on May 29, 2024, 11:52 a.m.