Jump to content
IGNORED

need help with a formula


Marius

Recommended Posts

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 :D

 

Thanks a lot

 

Marius

Link to comment
Share on other sites

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 by Kr0tki
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

What they said, but see attached for the formula in "dummy proof" form as requested :)

 

post-12834-0-98394100-1338539824_thumb.png

 

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 by simonl
  • Like 1
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 :D ... but please take this as a compliment. Your support is great. Thanks.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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