'P is a parameter of parabola.
Returns
p : number or symbolic expression
Notes
The absolute value of p is the focal length. The sign on p tells
which way the parabola faces. Vertical parabolas that open up
and horizontal that open right, give a positive value for p.
Vertical parabolas that open down and horizontal that open left,
give a negative value for p.
See Also
http://www.sparknotes.com/math/precalc/conicsections/section2.rhtml
Examples
>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.p_parameter
-4'

@property
def p_parameter(self):

    if (self.axis_of_symmetry.slope == 0):
        x = (- self.directrix.coefficients[2])
        if (x < self.focus.args[0]):
            p = self.focal_length
        else:
            p = (- self.focal_length)
    else:
        y = (- self.directrix.coefficients[2])
        if (y > self.focus.args[1]):
            p = (- self.focal_length)
        else:
            p = self.focal_length
    return p
