GetReciprocalDir
Appearance
| 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 |
| dir | Direction 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: | ||