pi_derivation.py
def derive_pi(r=1):
    """Derives pi through random point counting.

    r: radius of circle
    n: number of iterations of random point generation
    return: tuple of
        i - number of iterations
        pi - approxiamtion of value of pi
        x - random x val
        y - random y val
    """
    within_r = 0
    tup = random_tuple(r)
    for i in itertools.count(1):
        x,y = next(tup)

        if distance((x,y)) < r:
            within_r += 1

        pi = (4 * within_r) / i
        yield i, pi, x, y
Derives pi through random point counting.

    r: radius of circle
    n: number of iterations of random point generation
    return: tuple of
        i - number of iterations
        pi - approxiamtion of value of pi
        x - random x val
        y - random y val
    
Derives pi through random point counting.
r: radius of circle
n: number of iterations of random point generation
return: tuple of
i - number of iterations
pi - approxiamtion of value of pi
x - random x val
y - random y val
Derives pi through random point counting . r : radius of circle n : number of iterations of random point generation return : tuple of i - number of iterations pi - approxiamtion of value of pi x - random x val y - random y val
def derive_pi(r=1):
    within_r = 0
    tup = random_tuple(r)
    for i in itertools.count(1):
        x,y = next(tup)
        if distance((x,y)) < r:
            within_r += 1
        pi = (4 * within_r) / i
        yield i, pi, x, y
def derive_pi ( r = 1 ) : within_r = 0 tup = random_tuple ( r ) for i in itertools . count ( 1 ) : x , y = next ( tup ) if distance ( ( x , y ) ) < r : within_r += 1 pi = ( 4 * within_r ) / i yield i , pi , x , y
Derives pi through random point counting.
Derives pi through random point counting .
"""Derives pi through random point counting.

    r: radius of circle
    n: number of iterations of random point generation
    return: tuple of
        i - number of iterations
        pi - approxiamtion of value of pi
        x - random x val
        y - random y val
    """
r