Closed H1N1-dev closed 3 years ago
Well, computers don't think at all :) they do what is written! But sometimes we must just adapt ourselves.... some things here are fantastic (array and string functions), some somewhat less.
I had a problem with atan2() and arc... first the angles go clockwise, as opposite to math, and there are lots of graphic inconsistencies, but we must agree that something revolutionary is hardly expected as it it is in the design. anyway the link below may help you to understand how this works https://smallbasic.github.io/reference/718.html cheers!
@jsalai49 thanks for help :)
Now i am learned, atan2() arguments is (y, x), NOT (x, y)
And, atan2(5, 0)
means Y=5 and X=0.
This is standard function implementation in most programming languages.
Angles wrong there. ATAN2() thinks that 0 degrees in down side of screen. But, ARC function thinks that 0 degrees is right side.
'Bug?
color rgbf(0.3, 0.3, 0.3) ' Color the axes
line xmax/2, 0, xmax/2, ymax
line 0, ymax/2, xmax, ymax/2
color rgbf(1, 0, 0)
arc xmax/2, ymax/2, 200, 0, 0.1 ' 0 degrees.
' Zero angle its right side, yes?
ang = atan2(10, 0) ' X=10, Y=0. Right side?
print deg(ang) 'No! Right is 90 degrees?
... Also, atan2() range of output is-180 ~ 180
, and ARC range of angle is0 ~ 360
. But why?