How to Make a Ellipse Inside a Rectangle
- 1). Draw the rectangle centered on the origin of a Cartesian coordinate system. That is, the corners will be at the points (width/2, height/2), (width/2, -height/2), (-width/2, -height/2), (-width/2, height/2). Connect the corners at those points and you have your rectangle centered on the origin.
- 2). Construct the equation for the ellipse in standard form. The standard form of the ellipse equation is (x/a)^2 + (y/b)^2 = 1, where a and b are called the "semi-major" and "semi-minor" axes of the ellipse. The larger of a and b is the semi-major axis, and the smaller is the semi-minor axis.
- 3). Substitute for the semi-major and semi-minor axes. To make the ellipse just fit inside the rectangle, replace "a" with "width/2," and replace "b" with "height/2." The new equation for the ellipse becomes:
(2x/width)^2 + (2y/height)^2 =1. - 4). Make a table of the x and y values for the ellipse. The ellipse is symmetric about both the x and y axes, so all you need to do is find the values for the first quadrant, where x and y are both positive. By manipulating the equation from the previous step, you will find the y values are given by:
y = (1/2) * height * sqrt (1 - (2x/width)^2)
Plug in values of x between 0 and width/2, and you will get the corresponding value of y. - 5). Plot the points you found in the previous step. This will give you the portion of the ellipse in the first quadrant. Draw the mirror image of that curve on the other side of the x-axis, then draw the mirror image of that on the other side of the y-axis. You have now drawn an ellipse inside a rectangle.
Source...