@staticmethod
    def line_intersect_circle(line, circle):
        cross_line = line.a.vector.cross(line.b.vector)
        cross_lc = cross_line.cross(circle.c.vector)
        dot_circle = circle.c.vector.dot(circle.x.vector)
        if abs(cross_lc.z) > eps:
            a = cross_lc.dot(cross_lc)
            b = 2 * dot_circle * cross_line.cross(cross_lc).z
            circle = dot_circle * dot_circle * (cross_line.x ** 2 + cross_line.y ** 2) - cross_lc.z ** 2
            s = math.sqrt(b ** 2 - 4 * a * circle)
            z1 = (s - b) / (2 * a)
            x1 = (cross_lc.x * z1 - cross_line.y * dot_circle) / cross_lc.z
            y1 = (cross_lc.y * z1 + cross_line.x * dot_circle) / cross_lc.z
            z2 = -(s + b) / (2 * a)
            x2 = (cross_lc.x * z2 - cross_line.y * dot_circle) / cross_lc.z
            y2 = (cross_lc.y * z2 + cross_line.x * dot_circle) / cross_lc.z
            return Point(x1, y1, z1), Point(x2, y2, z2)
        else:
            return None
dataset/ETHPy150Open scot-dev/scot/scot/eegtopo/geo_spherical.py/Construct.line_intersect_circle/original