# Math Help...

## 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

##### 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

##### 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...

##### Share on other sites

That's a very interesting geometry problem

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

##### Share on other sites

Thank you! It works perfectly! Your a genius i say! A genius! Thanks for teaching me this math

##### Share on other sites

I'm glad I helped I think I know what it's for Cool idea.

## Create an account

Register a new account

×

• Wiki

• Back

• Git