Jump to content

Math Help...


BrettF
 Share

Recommended Posts

Hi. Say I have an image that looks like:

See that pink dot? I want to work out what circle it is in. Does anyone have any math equations that could help me? It would be greatly appreciated :P

Link to comment
Share on other sites

not shure about math functions, but you could do a simple pixelsearch to find the pink & then get the color around it with

PixelGetColor($foundx-3,$foundy-3)oÝ÷ ÚþÞÚºÚ"µÍÌÍÜ[ØÛÛÜI][ÝÙXÈÜ^[YHÙH[É][ÝÂÌÍÙ[[ÏT^[ÙXÚ
    ÌÍÖK ÌÍÖLK    ÌÍÖ  ÌÍÖL ÌÍÜ[ØÛÛÜBÌÍÞIÌÍÙ[[ÖÌBÌÍÞOIÌÍÙ[[ÖÌWB    ÌÍÞIÌÍÞ
ÌB ÌÍÞOIÌÍÞJÌB  ÌÍÜ^ÛÛÜT^[Ù]ÛÛÜ   ÌÍÞ  ÌÍÞJB[[  ÌÍÜ^ÛÛÜÉÝÉÌÍÜ[ØÛÛÜ

if you wanted to check down right of it

.. or something

hope you get the point, unless i don't understand what you want.

people are anoying, am i? ;) v2.95
Link to comment
Share on other sites

not shure about math functions, but you could do a simple pixelsearch to find the pink & then get the color around it with

PixelGetColor($foundx-3,$foundy-3)oÝ÷ ÚþÞÚºÚ"µÍÌÍÜ[ØÛÛÜI][ÝÙXÈÜ^[YHÙH[É][ÝÂÌÍÙ[[ÏT^[ÙXÚ
    ÌÍÖK ÌÍÖLK    ÌÍÖ  ÌÍÖL ÌÍÜ[ØÛÛÜBÌÍÞIÌÍÙ[[ÖÌBÌÍÞOIÌÍÙ[[ÖÌWB    ÌÍÞIÌÍÞ
ÌB ÌÍÞOIÌÍÞJÌB  ÌÍÜ^ÛÛÜT^[Ù]ÛÛÜ   ÌÍÞ  ÌÍÞJB[[  ÌÍÜ^ÛÛÜÉÝÉÌÍÜ[ØÛÛÜ

if you wanted to check down right of it

.. or something

hope you get the point, unless i don't understand what you want.

Yes. That was my other alternative, cept I'm pretty sure there is a way with pi or something... :P
Link to comment
Share on other sites

That's a very interesting geometry problem :P

Here's my solution:

*Assuming that the radius of the big circle is 50 and that each ring's width is the same (50/6), we can write the inequations for each one of the rings like this:

Circle 1

(X-50)^2 + (Y-50)^2 <= (50/6)^2

Circle 2

(X-50)^2 + (Y-50)^2 <= (2*50/6)^2

Circle 3

(X-50)^2 + (Y-50)^2 <= (3*50/6)^2

Circle 4

(X-50)^2 + (Y-50)^2 <= (4*50/6)^2

Circle 5

(X-50)^2 + (Y-50)^2 <= (5*50/6)^2

Circle 6

(X-50)^2 + (Y-50)^2 <= (50)^2

What you need to do is start checking from the first equation to see if the coordinates of the dot you have solve the inequation.. Start from circle one, continue with 2, then 3, etc... Notice that if you check with the circle 6 inequation, it'll always solve it. If the coordinates you have don't solve any of them, then the dot is outside the circle.

Unfortunately, I assumed wrong because their width is not the same. So, using my equations will tell you that, in the example, the pink dot is in the circle 4. This could be fixed if I knew the exact width of each one of them OR if you draw it so they are all the same ;)

Check this out.

$X=70
$Y=70

For $i=1 To 6 
    $Res=(($X - 50)^2 + ($Y-50)^2) <= ($i*50/6)^2
    If $Res Then ExitLoop
Next

If $Res Then
    MsgBox(0,"","The dot is in circle number: " & $i)
Else
    MsgBox(0,"","The dot seems to be outside the board")
EndIf
Edited by Nahuel
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...