Jump to content

GetRangeBearing

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (GetRangeBearing – created via PowerShell script (2025-11-11T21:12:35Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: GetRangeBearing
Function Description: Calculates the range and bearing between two points in world space, returning a table with range in meters and bearing in degrees from north.
File Location: cmm.positionFunctions.lua
Syntax: CMM.GetRangeBearing( table InitialVec , table DestinationVec )
Return Value: table
Parameters: Name Description
InitialVecOrigin vector with x, y, and z components representing the starting position in world space.
DestinationVecDestination vector with x, y, and z components representing the target position in world space.
Example: CMM.GetRangeBearing({x=100, y=50, z=10}, {x=200, y=100, z=20})
Example Description: Returns a table with range 141.42 meters and bearing 45 degrees, indicating the distance and direction from the origin to the destination point.
Related Functions:
Notes: