Determine the orientation of the conic section. Examine the foci coordinates (xf1, yf1) and (xf2, yf2). If xf1 = xf2 then the conic section is x-orientated (major axis perpendicular to the x-axis for an ellipse, or open to the top for a hyperbola). Alternatively, yf1 = yf2 and the conic section is y-orientated (major axis perpendicular to the y-axis for an ellipse, or open to the sides for a hyperbola).
Calculate the coordinates of the conic section centroid. Consider an x-orientated conic section. The x-coordinate of the centroid (xc) is the same as x-coordinates of the foci (xc = xf1 = xf2). The y-coordinate of the centroid (yc) lies halfway between foci:
yc = 0.5*(yf1+yf2)
The opposite would be true for a y-orientated conic section, namely: xc = 0.5*(xf1+xf2) and yc = yf1 = yf2.
Write down the general equation for the conic section. For an ellipse:
(x-xc)^2/a^2 + (y-yc)^2/b^2 = 1
In the above equation, (xc, yc) is the coordinate of the conic section centroid calculated in Step 2, and "a" and "b" are the half-lengths of the conic section axes in the x- and y-directions respectively and are as yet unknown.
For an y-orientated hyperbola:
(x-xc)^2/a^2 - (y-yc)^2/b^2 = 1
For an x-orientated hyperbola:
-(x-xc)^2/a^2 + (y-yc)^2/b^2 = 1
In the hyperbola equations (xc, yc) is once again the conic section centroid while the ratios "+-a/b" and "+-b/a" are the gradients of the asymptotes for a y-orientated and x-orientated hyperbola respectively. Again "a" and "b" are as yet unknown.
Solve for the unknowns "a" and "b". Substitute the given x-intercept coordinates, (x1,0) and (x2,0), into the relevant general equation and solve for "a" and "b" simultaneously.
An alternative method for solving the unknowns should only one x-intercept be given involves first calculating the distance from the centroid to a focus point. This distance (f) is half the distance between the two foci. For a conic section the following relationship is also true:
f^2 = a^2 + b^2
This relationship can be used along with the appropriate general equation, into which the given x-intercept coordinate is substituted, to solve for "a" and "b" simultaneously.
Calculate the y-intercepts. Set x = 0 in the fully defined general equation and solve for y.