import math


def nd_generator(R1, R2):
    """
    A function to generate normal distribution by using random number of R1 and R2
    
    Parameters:
    -----------
    R1: random number between 0-1
    R2: random number between 0-1

    Returns:
    --------
    Z1: standard normal variate
    Z2: standard normal variate
    """
    Z1 = (-2.0*math.log(R1))**(0.5)*math.cos(2*math.pi*R2)
    Z2 = (-2.0*math.log(R1))**(0.5)*math.sin(2*math.pi*R2)
    return Z1, Z2