I'm trying to write an equation for a parabola using the distance formula. My textbook shows this:

Why can't my distance from the focus be this:

And why can't my distance from the directrix be this:

This doesn't seem like a wrong move to me but I clearly got the wrong answer. Is it possible to get the right answer using the equations I purposed?
Thank you in advance! please ask for any clarifying questions.


Consider a point $A(a,b)$ and a point $B(c,d)$ and draw the parrallel line to the $x$-axis and $y$-axis.
What is the lenght of $EB$ and $AE$? By the definition of the lenght of a segment parallel to the coordinates axis, we have: $$EB = |c - a|=|a-c|$$ and $$AE=|d-b|=|b-d|$$ We have also that $AEB = 90°$ and so by the Pythagorean theorem: $$AB=\sqrt{EB^2+AE^2}=\sqrt{|c - a|^2+|d-b|^2}=\sqrt{(c - a)^2+(d-b)^2}$$