Suppose we have a hyperbola with the center \((0,0)\):
A hyperbola is a set of points, such that for any point \(P\) of the set, the absolute difference in the distances from point \(P\) to the two foci (shown in blue) is constant:
Let's call the shortest distance from the origin to either of the foci \(c\):
Let's call the shortest distance from the origin to either of the hyperbola line \(a\):
The absolute difference between \(|PF_1|\) and \(|PF_2|\) is \(2a\). Let \(P\) be at \((p_x,p_y)\), \(F_1\) be at \((f_{1x}, 0)\) and \(F_2\) be at \((f_{2x},0)\). Now let's define another point \(A = (p_x,0)\), where \(\angle PAF_{1x} = 90^\circ \):
If we use the Pythagorean theorem:
Since \(|PF_1|-|PF_2|=2a\):
Since \(c=f_{2x}=-f_{1x}\):
Rearranging:
We can cancel \((p_y)^2\) and then simplify:
We can square both side:
Expand:
Simplify:
Rearrange and simplify further:
This gives us our equation for a hyperbola:
You can view this in desmos. If you set \(c=0\), you get a circle, and if you set \(c \lt a\), then you get an ellipse. Also, if both the denominators are 1, then you get something called a unit hyperbola: