utils.math.world3DtoPolar3D¶
utils.math.world3DtoPolar3D(center, position)
Arguments¶
Argument | Data Type | Optional | Default Value | Explanation |
---|---|---|---|---|
center | coords | No | - | Coordinates as center |
position | coords | No | - | Coordinates as position |
Note
This function is related to utils.math.polar3DToWorld3D.
Dependency¶
local utils = M("utils")
Example¶
local center, position = vector3(393.5002, -1262.998, 32.54996), vector3(332.0094, -1336.234, 32.44715)
local polarDeg, azimuthDeg, radius = utils.math.world3DtoPolar3D(mycoords, vector3(332.0094, -1336.234, 32.44715))
print('polar: ' .. polarDeg, 'azimuth: ' .. azimuthDeg, 'radius: ' .. radius) -- Returns polar: 130.03988420024, azimuth: 89.930982074227, radius: 93.566329956055