def perpendicular_segment(self, p):
        p = Point3D(p)
        if p in self:
            raise NotImplementedError("Given point should not be on the line")
        t = Dummy()
        a = self.arbitrary_point(t)
        b = [i - j for i, j in zip(p.args, a.args)]
        c = sum([i*j for i, j in zip(b, self.direction_ratio)])
        d = list(solveset(c, t))
        e = a.subs(t, d[0])
        return Segment3D(p, e)
Create a perpendicular line segment from `p` to this line.
dataset/ETHPy150Open sympy/sympy/sympy/geometry/line3d.py/LinearEntity3D.perpendicular_segment