I use those polar coordinates all the way in my Leap of Faith project.
Did you notice that when calculating point position it is a little off with the draw_circle figure? Like it goes one pixel extra at the left side and one pixel off at the right?
I think this happens due to round-ups. I've found that making pi a better accuracy provides better results, but you don't seem to use pi.
I am not sure there is Math library available in pico? Since I wasn't able to use that Math.Pi I decalred my own.
Hey! Yeah I noticed thta about draw circle, and I suspect it is using something different other than sin and cos.. check out http://www.helixsoft.nl/articles/circle/sincos.htm - and read the "another way to draw a circle"
As for Math.PI, no there isnt one as far as I can tell, you can make PI but I dont think it is that accurate because the precision is only down to the 0.0000s - unless there is a different way to have more precise numbers!
Thanks! I ll check it out
Also I believe here
x = center_x + radius * cos(a) y = center_y + radius * sin(a)
y = center_y + radius * sin([b]-a[/b])
But your point seems at the right place on the demo so maybe you fix it later, sorry I didn't drill too deep.
Thanks for digging in my code :) Appreciate the feedback too.
I'm not sure why, but sin(-a) was not working as I thought it would (i know the docs say that it is opposite, but idk lol maybe I'm doing something weird here!)
Maybe its not inversed anymore?? or perhaps I did something wrong :P
You're welcome! I am glad I could discuss something similar I've been figuring out lately.
I think it is still inverted as I tested it but you seem to eliminate the minus here
return sqrt(delta_x*delta_x + delta_y*delta_y)
Good that works but just mind if going to reuse it somewhere.
That function is only for finding the angle again but via a different calculation purely for educational purposes. It's not being used for finding x and y. Maybe the Arcosine is just making it go counter clockwise instead???? Correct me if I'm wrong, I haven't taken trig!!
[Please log in to post a comment]