Slight inaccuracy with Circle
Posted: Sun Jun 07, 2020 9:41 am
I just did bit of a test to basically try out collision detection with a circle, and it seems like there might be a small inaccuracy with a circle command (nothing critical)
If you try this out you can notice that one of the dots is exactly 50 distance away, which I would think should mean that it should appear exactly at the outlet of the circle. However, it seems to be one pixel off from its location.
If I change the number to at least 3:
Then I'm not sure, but looks like the center might be at a right location.
This was tested on Hollywood 8 Win64.
Code: Select all
Circle(250, 250, 50, #WHITE)
cx = {310, 320, 330, 340, 350}
cy = {300, 310, 320, 330, 340}
For n=0 To 4
Circle(cx[n]-1, cy[n]-1, 1, #WHITE)
inside=False
xpow=(cx[n]-300)
ypow=(cy[n]-300)
xpow=Pow(xpow, 2)
ypow=Pow(ypow, 2)
totalpow=xpow+ypow
distance=Sqrt(totalpow)
DebugPrint("distance: "..distance)
Next
WaitLeftMouseIf I change the number to at least 3:
Code: Select all
Circle(cx[n]-3, cy[n]-3, 3, #WHITE)This was tested on Hollywood 8 Win64.