Make an equation inversely relating a radius to a punctuation

21 Views Asked by At

Lets have a shooting target. (Sorry, can't give an example image since I'm on mobile data)

It has several rings which represent the score. the outer ring is 1, and the inner one is 11.

Lets assume that 7.3 points its the threshold that distinguishes a valid shot from an invalid one (in case of shots without punctuation)

I represent in my program the ellipses (which make the target), as rotated rectangles, and I have one for the outer ring (between 0 and 1 points), and one for the threshold (between 7.2 and 7.4, valid/invalid).

One shoots the target. My algorithm find out the x and y of the shot, and calculates its angle(theta) and distance(a) from the center of the target. Then calculates the radius(r) of the threshold at the given theta angle.

If a its smaller than 'r', I can assume it was inside. Now what about punctuating? When 'a' is 0, it represents an 11 points shot (11P), but then, when 'a' is 'r', it represents 7.3P.

Basically I need to relate the distance from the center, to the radius, to obtain a punctuation that is inversely proportional to the distance.

How can I do an equation of it? It seems somewhat simple, but not being a direct relation confused me and a few more college mates.

Then what? What about knowing it isn't within the threshold, having the radius(r) smaller than 'a', but 'a' smaller than the radius of the outer ring(o), how can I punctuate?

I can't create a condition for every ring, since 8.65 can be a valid punctuation.

1

There are 1 best solutions below

0
On BEST ANSWER

Managed to find a way.

It is a linear equation, has to be, hence it must be represented y = mx+b.

b is obvious, at 0 distance y=11. What about that mx?

The slope is going to be negative. The bigger the radius is the closest to 0 the slope will be, and when the radius tends to 0, the slope will tend to negative infinity.

What will be the variation along the relevant part of the domain(which is [0,radius])? That variation is 7.3(at zero) - 11(at radius), so -3.7

Basically those -3.7 are distributed along the domain/radius, so m = -3.7/r

All together: f(x) = (-3.7/radius)*x + 11