I am officially puzzled and out of my waters.

If you divide the circle in four equal parts using two diagonal lines, you find that 25 percent of all points have a x-value of more than 70 percent of the radius. Using 200 as radius, 25% of all points x > 141,42 (= cos(45°)*200). But using your method only 60/400 = 15% of points have value x greater than 141,42. So there ecertainly is a bias towards points in the upper and lower quarter.

I have no idea why this bias isn't influencing your results. Maybe because the second point is also influenced by this bias. But how?

I wonder whether it's okay to keep this discussion on the list. We are straying far from matters LiveCode.

Thomas


Am 05.09.2020 um 20:28 schrieb Roger Guay via use-livecode:
Aha, in prepping my code to send to you, I found an error! Now the Cartesian 
Coord code is consistent with the Polar Coord code producing a ratio of about 
⅓. Here is the code:

on mouseDown

        getStuff

end mouseDown


local tR, tX0, tY0, txl, tX1, tY1, tconstL, tTotCount, tL, tLongCount, tLocA, 
tLocB


on getStuff

        put item 1 of the loc of grc OuterCircle into tX0

        put item 2 of the loc of grc OuterCircle into tY0

        put the width of grc OuterCircle/2 into tR

        put the left of grc outerCircle into tXl

        put 2*tR*cos(Pi/6) into tconstL

        put "" into tTotCount

        put "" into tLongCount

        emptyFlds

end getStuff


on mouseUp

        lock screen

        repeat 10000

                add 1 to tTotCount

                PickApointA

                PickApointB

                set the points of grc theChord to tLocA, tLocB

                GetLength tLocA, tLocB

        end repeat

        put tTotCount into fld "totcountFld"

        put tLongCount/tTotCount into fld "RatioFld"

        unlock screen

end mouseUp


on PickApointA

        set the numberFormat to "#."

        put tXl + random(400) into X

        put sqrt(tR^2 - (X-tX0)^2) - tY0 into y

        get random(2)

        if it is 1 then put x, + y+2*tY0 into tLocA

        else put x, - y into tLocA

end PickApointA


on PickApointB

        set the numberFormat to "#."

        put tXl + random(400) into X

        put sqrt(tR^2 - (X-tX0)^2) - tY0 into y

        get random(2)

        if it is 1 then put x, + y+2*tY0 into tLocB

        else put x, - y into tLocB

end PickApointB


on GetLength pLocA, pLocB

        put item 1 of pLocA into PX1

        put item 2 of pLocA into Py1

        put item 1 of pLocB into PX2

        put item 2 of pLocB into Py2

        set the numberFormat to "#.0"

        put (pX2- pX1)^2 + (pY2- pY1)^2 into Lsquared

        put Sqrt(Lsquared) into tL

        if tL > tconstL then add 1 to tLongCount ---

        put tLongCount into fld "LongCountFld"

end GetLength


Thanks,
Roger


On Sep 5, 2020, at 11:07 AM, Thomas von Fintel via use-livecode 
<use-livecode@lists.runrev.com> wrote:

„I am known for making many more mistakes than not!“
Aren‘t we all?
I guess using Cartesian coordinates for choosing points on a circle could 
produce some bias, though I have no clear idea how.
So, what is your code?

Thomas

Am 05.09.2020 um 19:15 schrieb Roger Guay via use-livecode 
<use-livecode@lists.runrev.com>:

I am known for making many more mistakes than not!

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to