from math import cos, pi, sqrt


def linear_dist_sphere(radius: float, surf_dist: float, depth_a: float, depth_b: float) -> float:
    """ 
    The purpose of this function is to find the actual, linear distance between the hypocenter of 
    and earthquake and the bottom of a fracking well.  It's a more general problem/solution, though:
    
    returns c:  Linear distance through a sphere between two points at or beneath the surface of a sphere
    inputs:
        radius: radius of the sphere;       
        surf_dist: 'great circle' distance between the epicenters of the two points;    
        depth_a, depth_b:  depth of each of the two points beneath the surface.
    
    """
    circumferance = 2 * pi * radius
    theta_rad = (surf_dist / circumferance) * ( 2 * pi )
    
    a = radius - depth_a
    b = radius - depth_b
    c = sqrt(a**2 + b**2 - 2 * a * b * cos(theta_rad))
    return c