Distribute spheres on ellipse pattern with python

So your function is using “Polar Coordinates”. That means you’re doing your calculations using the angle (often symbolized by the Greek letter θ “theta”), and radius.

That formula you found is using “Cartesian Coordinates”. That means it does its calculation using X and Y.

So instead, lets look at the equation for an ellipse in polar coordinates:
radius = (w*h) / sqrt((w*sin(angle))**2 + (h*cos(angle))**2)
Here’s a Desmos graph that lets you see the equation, and mess with the width (w) and height (h).

So to make your code work, you’ll need variables degrees, width and height, and you’ll have to figure out a different radius value for every different rotation value you calculate using that equation.