angstep2xy {cylcop}R Documentation

Calculate the Next Position in a Trajectory from a Turn Angle and a Step Length

Description

The x-y-coordinates of a position in 2-D space is calculated from the angle between that position and the 2 previous ones in the trajectory and the distance between that position and the previous one.

Usage

angstep2xy(angle, steplength, prevp1, prevp2)

Arguments

angle

numeric value of the turn angle or a circular object, either in [0, 2\pi) or in [-\pi, \pi)

steplength

numeric value giving the distance between the position and the previous one.

prevp1

numeric vector holding the x and y coordinates of the previous position.

prevp2

numeric vector holding the x and y coordinates of the position before the previous one.

Value

The function returns a numeric vector holding the x and y coordinates of the position

Examples

 angstep2xy(1.5*pi, 2, prevp1 = c(1, 4), prevp2 = c(2, 7.5))
 angstep2xy(-0.5*pi, 2, c(1, 4), c(2, 7.5))

[Package cylcop version 0.2.0 Index]