In [ ]:
def refract(face)
    thetaRefracted = asin((self.n/ray.world_n)*sin(thetaIncident))
    a1 = ray.directionVector - (face * dot(ray.directionVector,face))
    ray.directionVector = (1*cos(thetaRefracted)*face) + (sin(thetaRefracted)*a1.norm())
    return

def reflect(face)
    thetaRefracted = thetaIncident
    a1 = ray.directionVector - (self.normalFront * dot(ray.directionVector,self.normalFront))
    ray.directionVector = (-1*cos(thetaRefracted)*self.normalFront) + (sin(thetaRefracted)*a1.norm())
    return