Jump to content
  • Advertisement
Sign in to follow this  
kelcharge

Creating a Circle through an graph equation?

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

On the graphing calculator I have, it doesn't come with drawing primitives and I seem to have forgotten the equation for a cirlce. e.g. y=(forgot what goes here).

Share this post


Link to post
Share on other sites
Advertisement
ONE form of the Cartesian Equation for a circle is;

(x-a)^2 + (y-b)^2 = r^2

where (a,b) denotes the CENTRE of the circle and r denotes the RADIUS of the circle. (x, y) would denote the actual pixel plot on the screen.

The Parametric Equations of a circle, which for programming would perhaps be more useful, are;

x = rcosA + a
y = rsinA + b

where A denotes the ANGLE of the radial line.

Not really a whizz on this forum (but I sure know my math), cos I don't use it much... Otherwise, I'd show you a graphic that perfectly shows how these equations work.

One bit of optimization advice... If u need it that is... Is to try and use Trigonometric tables which hold the pre-computed values of cosA and sinA, as the angle A ranges from 0 - 360 degrees... Or 0 - 2*pi radians!

Hope this helps... If your still a bit confused... I'll try and send u a graphic :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!