Marius Posted June 1, 2012 Share Posted June 1, 2012 Hi atari fans! Look at the picture please.... What is the right scientifical formula to find value of y in a circle when x=known. Let's say x1 = 5... what are then the y1a and y1b-coördinate on the circle? Let's say x2 = -1.... then, what is the y2a and y2b-coördinate on the circle? I really s*ck at this mathematic things.... I hope someone can give me a dummy-proof formula Thanks a lot Marius Quote Link to comment Share on other sites More sharing options...
Kr0tki Posted June 1, 2012 Share Posted June 1, 2012 (edited) For a circle centered at the <0, 0> coordinates, the formula is x^2 + y^2 = r^2 where r is the circle's radius. So to get y from a known x and r, you compute y1 = sqrt(r^2 - x^2) y2 = -sqrt(r^2 - x^2) Shouldn't this topic be in the Computers, Science and Technology subforum? Edited June 1, 2012 by Kr0tki 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 1, 2012 Share Posted June 1, 2012 You'd also need to know the radius of the circle. r2 = X2 + y2 So, given you know the values of r and x: y = SQR ( y2 - x2 ) There's trig functions that can also be used. e.g. if you know radius, X/Y centre of circle and angle, then Sin/Cos can be used to determine X/Y given only an angle. As for the rest... I usually have to look them up. 1 Quote Link to comment Share on other sites More sharing options...
simonl Posted June 1, 2012 Share Posted June 1, 2012 (edited) What they said, but see attached for the formula in "dummy proof" form as requested 10 GRAPHICS 8:COLOR 1 20 REM CENTER IS 50,50 30 A=50 40 B=50 50 REM RADIUS IS 25 60 R=25 70 FOR X=-R TO R 80 REM (Y-B)2 = R2 - (X - A)2 90 X2=X*X 100 R2=(R*R) 110 Y=SQR(R2-X2) 120 PLOT A+X,B+Y 130 PLOT A+X,B-Y 140 NEXT X Cheers, Simon Edited June 1, 2012 by simonl 1 Quote Link to comment Share on other sites More sharing options...
Marius Posted June 1, 2012 Author Share Posted June 1, 2012 Shouldn't this topic be in the Computers, Science and Technology subforum? You are probably right. I needed this info for something I would like to code on my Atari, so that's why I asked this here in the first place. Thanks for your answer anyway, it helped a lot! Quote Link to comment Share on other sites More sharing options...
Marius Posted June 1, 2012 Author Share Posted June 1, 2012 You'd also need to know the radius of the circle. r2 = X2 + y2 So, given you know the values of r and x: y = SQR ( y2 - x2 ) There's trig functions that can also be used. e.g. if you know radius, X/Y centre of circle and angle, then Sin/Cos can be used to determine X/Y given only an angle. As for the rest... I usually have to look them up. Thanks rybags. Sometimes I feel a little guilty towards you... Rybags is almost the same as 'FAQ' for me ... If i don't know... ask rybags ... but please take this as a compliment. Your support is great. Thanks. 1 Quote Link to comment Share on other sites More sharing options...
Marius Posted June 1, 2012 Author Share Posted June 1, 2012 What they said, but see attached for the formula in "dummy proof" form as requested How great was that! Thanks Simonl! Very nice! Quote Link to comment Share on other sites More sharing options...
bomberpunk Posted June 1, 2012 Share Posted June 1, 2012 1) sugar 2) spice 3) everything nice 4) chemical x Quote Link to comment Share on other sites More sharing options...
Fox-1 / mnx Posted June 1, 2012 Share Posted June 1, 2012 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.