Jump to content

Distance3D

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (Distance3D – created via PowerShell script (2025-11-11T21:12:33Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: Distance3D
Function Description: Calculates the 3D distance between two vectors, each defined by x, y, and z components, returning the magnitude of the vector difference.
File Location: cmm.positionFunctions.lua
Syntax: CMM.Distance3D( table vec3_1 , table vec3_2 )
Return Value: number or nil
Parameters: Name Description
vec3_1{x <number>, y <number>, z <number>} – first 3D vector, must have all three components.
vec3_2{x <number>, y <number>, z <number>} – second 3D vector, must have all three components.
Example: CMM.Distance3D({x=10, y=20, z=30}, {x=40, y=50, z=60})
Example Description: Computes the 3D distance between two points with full x, y, and z coordinates, returning the magnitude of the vector difference.
Related Functions:
Notes: