User Tools

Site Tools


prpl:shortestangle

<- PRPL reference <- Math

ShortestAngle

ArgumentsResultNotation
float float float [float float- float]

Description

Given two angles, calculates the shortest angle between the two. Useful for determining which direction a unit should rotate in order to turn to a given direction. A positive or negative value will be returned in the range of PI to -PI. Negative values indicate clockwise rotation.

Examples

trace(ShortestAngle(1.1 2.5)) 
prpl/shortestangle.txt · Last modified: 2016/12/02 18:33 by 127.0.0.1