Open fergusq opened 1 year ago
Atan(a) is more familiar from math lessons, so I think it's better to have them both so children don't have to think how to calculate it using Atan2.
The names I chose are the ones used in Visual Basic .NET: https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/math-functions
Other Basics may have different names. For example, QBasic has ATN for arcus tangent.
Ok, I guess Atan
it is. Looking at the documentation of Coolbasic, one way would be to have Asin
, Acos
and Atan
as those are functions known from math lessons, but then have something like GetAngle
which takes in parameters x1, y1, x2, y2
and then computes atan2(y2-y1, x2-x1)
internally. This would address the most common use of atan2
which is to compute the angle between two points.
There's also some bikeshedding to be done: Should the names of the functions be
Asin
,Acos
,Atan
,Atan2
ASin
,ACos
,ATan
,ATan2
ArcSin
,ArcCos
,ArcTan
,ArcTan2
In addition, I don't entirely like having separate
Atan
andAtan2
. Maybe having onlyAtan2
and instructing to call it withAtan2(a, 1)
to getAtan(a)
is enough?