Merchandise
Carrier Command 2
Stormworks
Sign In
Wiki
Support
Votes by users: 2
Tue 31 December 2024 19:12
User
Evalent
2
Awards granted for Implemented Issues
CPU
AMD Ryzen 5 3600 6-Core Processor (x64)
GPU
NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2 4.6.0 NVIDIA 560.94
RAM
16384MB RAM
OS
Windows 10 Pro 10.0 64bit
Product
Stormworks 64-bit
Version
v1.13.2
Closed (Not An Issue)
Feature
This will be useful in some situations (such as finding correct azimuth when converting cartesian coords to spherical ones)
Tue 31 December 2024 19:13
function atan2(y, x)
if x>0 then return math.atan(y/x)end
if x<0 and y>=0 then return math.atan(y/x)+math.pi end
if x<0 and y<0 then return math.atan(y/x)-math.pi end
if x==0 and y>0 then return math.pi/2 end
if x==0 and y<0 then return -math.pi/2 end
if x==0 and y==0 then return 0 end
end
Thu 02 January 2025 09:52
Developer
Thank you for suggestion but math.atan is already there.
Issue closed