Parametric Equations for a Circle
I spent way too long trying to animate particles along circular paths in a rendering engine I was building. The issue wasn't finding the formula—it was understanding why the standard approach kept producing ellipses when I rotated things. That disconnect between what the math promised and what my GPU drew is what pushed me to really dig into the parametric form. The Cartesian equation x² + y² = r² looks clean on paper. Try rendering it though. You need to solve for y at every x step, which gives you two branches and a vertical tangent problem. The parametric form sidesteps that entirely by treating both coordinates as independent functions of a third variable—time, angle, whatever you call it. x(t) = h + r cos(t)
y(t) = k + r sin(t)
That's it. (h,k) is the center, r is the radius, and t runs from 0 to 2 for one full revolution. I know that feels almost insultingly simple after all the hand-waving in textbooks, but here's the thing nobody tells you: the parameter t doesn't have to be an angle in the geometric sense. In physics simulations, t is often actual time, and the "angular velocity" can change. That's where things get interesting—and where I got tripped up.
Deriving It From First Principles
Start with the unit circle. By definition, any point on it has coordinates (cos , sin ). This comes straight from the unit circle definition in trigonometry—you're projecting the angle onto the x and y axes. Now scale by r and shift by (h,k). You get the general form above. It's not magic, it's just coordinate geometry wearing a disguise. But there's a subtlety most people skip. The parametrization traces the circle clockwise or counterclockwise depending on your sign convention. With the standard form using +r cos and +r sin, you go counterclockwise starting from the rightmost point. Flip the sine to negative and you reverse direction. This matters enormously if you're doing animation or collision detection and the orientation is hardcoded somewhere downstream.
Get the Full Details

Common Pitfalls That Wreck Your Implementation
Pitfall one: mixing degrees and radians. If your language's trig functions expect radians but you're passing degrees, your circle will look nothing like a circle. I wrote a whole particle system before catching this because I imported a constant that looked reasonable but was scaled for degrees. Took me three hours to trace it back. Pitfall two: the periodicity boundary. At exactly t = 2, you're back at t = 0. In floating-point arithmetic, cos(2) 1 exactly. If your code checks for exact equality to close a loop, it won't trigger. Use a small epsilon threshold or clamp t to [0, 2) instead. Pitfall three: non-uniform scaling. If you use different multipliers for x and y—say, x = h + a cos(t), y = k + b sin(t)—you no longer have a circle. You have an ellipse. This sometimes happens accidentally when your coordinate system isn't isotropic, like when your screen pixels aren't square or your physics engine uses different units per axis. I encountered this in a CAD tool where the viewport aspect ratio caused circles to render as ellipses unless I explicitly compensated in the parametrization.
My Specific Edge Case
Here's the problem that actually made me understand this stuff: I was building a CNC-style path generator where the tool needed to trace a circle but the motor controller accepted only discrete step commands. The ideal parametric curve would produce sub-step positions between actual motor movements. My workaround was to precompute the parametric equation at a fine resolution, then round each point to the nearest valid step coordinate. The resulting path was visually close to circular but introduced tiny position errors at the cardinal points where the derivative is purely horizontal or vertical. I fixed it by adding a correction term—a small offset proportional to the second derivative—that compensated for the quantization error. It's not a perfect solution, but it kept the error below 0.5% of the radius, which was acceptable for the application. Sometimes you don't want constant angular speed. Consider a camera orbiting a target at varying velocity—the parameter t might represent elapsed time with a custom speed profile v(t). You'd write: x(t) = h + r cos( v() d)
y(t) = k + r sin( v() d)
This is genuinely useful for animation where you want the motion to ease in and out rather than spin uniformly. The circle is still mathematically correct; the parameter just doesn't map linearly to angle anymore. Just be aware that your "t" no longer has a direct geometric interpretation, which can make debugging harder.

When the Parametric Approach Fails
Parametric equations aren't a panacea. For implicit surface queries—like "is this point inside the circle?"—the Cartesian form x² + y² r² is faster. For rendering filled regions, scanline algorithms work directly with the implicit equation. The parametric form shines for curve drawing, path following, and animation, but it's overkill for simple containment tests. I learned that the hard way when I used a parametric loop to check point-in-circle membership for a collision system processing thousands of objects per frame. Switching to the implicit form cut the operation from roughly 20 microseconds to about 3 microseconds per check. There's also the case of self-intersecting parameterized curves, like a lemniscate or figure-eight. Those aren't circles, obviously, but the lesson carries: a parametric representation can create topological complications that the Cartesian form doesn't reveal. For circles specifically, this isn't an issue—the parametrization is injective on [0, 2)—but it's worth keeping in mind if you generalize to other curves.
Quick Reference
Center at origin, radius r: x = r cos(t), y = r sin(t), t [0, 2)
Center at (h,k), radius r: x = h + r cos(t), y = k + r sin(t), t [0, 2)
Clockwise orientation: x = h + r cos(t), y = k r sin(t)
Starting from top instead of right: x = h + r sin(t), y = k + r cos(t) The last one is the one I end up looking up every time. We memorize the standard form, but the moment you need to start from a different point or direction, the mental rotation takes longer than it should. Write it down. Keep a cheat sheet.