User Tools

Site Tools


4rpl:commands:shortestangle

This is an old revision of the document!


Index
Math Utility

ShortestAngle

ShortestAngle(<-cur <-new) ->rotAngle

Description

Given two angles in radians, 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))

Index

4rpl/commands/shortestangle.1662298103.txt.gz · Last modified: 2025/02/14 14:56 (external edit)