GetDistance2D
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetDistance2D | |
| Function Description: | Calculates the Euclidean distance between two 2D points using their x and y coordinates, returning the straight-line distance in meters. | |
| File Location: | cmm.positionFunctions.lua | |
| Syntax: | CMM.GetDistance2D( number xPoint1 , number yPoint1 , number xPoint2 , number yPoint2 ) | |
| Return Value: | number | |
| Parameters: | Name | Description |
| xPoint1 | X-coordinate of the first point. | |
| yPoint1 | Y-coordinate of the first point. | |
| xPoint2 | X-coordinate of the second point. | |
| yPoint2 | Y-coordinate of the second point. | |
| Example: | CMM.GetDistance2D(0, 0, 3, 4) | |
| Example Description: | Computes the distance between points (0, 0) and (3, 4), returning 5.0. | |
| Related Functions: | ||
| Notes: | ||