#NEWLINE# def perpendicular_line( self , p ) : #NEWLINE# #INDENT# 'Create a new Line perpendicular to this linear entity which passes\n        through the point `p`.\n\n        Parameters\n        ==========\n\n        p : Point3D\n\n        Returns\n        =======\n\n        line : Line3D\n\n        See Also\n        ========\n\n        is_perpendicular, perpendicular_segment\n\n        Examples\n        ========\n\n        >>> from sympy import Point3D, Line3D\n        >>> p1, p2, p3 = Point3D(0, 0, 0), Point3D(2, 3, 4), Point3D(-2, 2, 0)\n        >>> l1 = Line3D(p1, p2)\n        >>> l2 = l1.perpendicular_line(p3)\n        >>> p3 in l2\n        True\n        >>> l1.is_perpendicular(l2)\n        True\n\n        ' #NEWLINE# p = Point3D ( p ) #NEWLINE# if ( p in self ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'Given point should not be on the line' ) #NEWLINE# #UNINDENT# t = Dummy ( ) #NEWLINE# a = self . arbitrary_point ( t ) #NEWLINE# b = [ ( i - j ) for ( i , j ) in zip ( p . args , a . args ) ] #NEWLINE# c = sum ( [ ( i * j ) for ( i , j ) in zip ( b , self . direction_ratio ) ] ) #NEWLINE# d = list ( solveset ( c , t ) ) #NEWLINE# e = a . subs ( t , d [ 0 ] ) #NEWLINE# return Line3D ( p , e )