Draw Oval - How It Works

Circle

image missing

A point on a circle can be defined by its x,y coordinates. Given the radius of the circle r and the x coordinate, use the following formula to calculate the point's y coordinate.

r2 = x2 + y2

y = sqrt(r2 - x2)

Now that you have the x,y coordinate of a point on a circle, reduce y using the tilt angle. (This assumes the viewer is at +Z infinity with no perspective.)

Given circle radius r and tilt angle θ ...

y = sqrt(cos2(θ) * (r2 - x2))

y = round(sqrt(cos2(θ) * (r2 - x2)))

Do this for any x coordinate you want to plot.

Note: sqrt is the square root function. It returns a float. For pixel coordinates round y to an integer.

FYI

cos(0°)0.000
cos(30°)0.866
cos(45°)0.707
cos(60°)0.500
cos(90°)1.000