Jump to content

VectorMag

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (VectorMag – 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: VectorMag
Function Description: Calculates the magnitude of a 3D vector using the Euclidean norm formula, returning the square root of the sum of squared components.
File Location: cmm.positionFunctions.lua
Syntax: CMM.VectorMag( table VM )
Return Value: number
Parameters: Name Description
VM{x <number>, y <number>, z <number>} – 3D vector with x, y, and z components.
Example: CMM.VectorMag({x=3, y=4, z=0})
Example Description: Computes the magnitude of a 3D vector with components 3, 4, and 0, returning 5.0.
Related Functions:
Notes: