You need to calculate the distance from (x1,y1) to (0,0). If < 1.0, you have a hit.
And please use English, as the Board Rules request. This is not a chat room.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Looks like a spin off from the monte carlo method for estimating Pi.
use the equation for a circle;
[tex] x^2 + y^2 = r^2 [/tex]
You may need to shift that so it is on the positive x and y axis to make more sense of the numbers? Don't know though.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
You don't need PI nor circles, just the distance formula, as SOS mentioned in your duplicate post.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
>You don't need PI
I never said you needed PI, but the purpose of his assignment is to estimate the value of Pi, hence why I said it was a 'monte carlo estimation of Pi clone'. Google it.
>nor circles
Well the equation which describes the function of a circle where the centre is located at (0,0) is based directly on pythag's eqn (or as you put it the distance formula). So yeah it's basically the same thing.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439