# Creating a Circle through an graph equation?

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

## 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 on other sites
(x^2 + y^2)^0.5 = r
x^2 + y^2 = r^2
y^2 = r^2 - x^2
y = (r^2 - x^2)^0.5

##### Share on other sites
The parametric formula is
x = r sin(t)y = r cos(t)

##### Share on other sites
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 :-)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634091
• Total Posts
3015435
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!