Jump to content

GetReciprocalDir

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: getReciprocalDir
Function Description: Calculates the reciprocal direction of a given direction in degrees by adding 180 degrees and adjusting for wrap-around at 360 degrees.
File Location: cmm.positionFunctions.lua
Syntax: CMM.getReciprocalDir( number dir )
Return Value: number
Parameters: Name Description
dirDirection in degrees, ranging from 0 to 359, representing the original direction of a vector or unit.
Example: CMM.getReciprocalDir(45)
Example Description: Returns 225, the direction exactly opposite to 45 degrees, demonstrating the function's ability to compute reciprocal directions with proper modulo handling.
Related Functions:
Notes: