'Refract, reflect, absorb, and/or scatter ray. This function may create and return new rays'

def propagateRay(self, ray):

    surface = self.surfaces[0]
    (p1, ai) = surface.intersectRay(ray)
    if (p1 is not None):
        p1 = surface.mapToItem(ray, p1)
        rd = ray['dir']
        a1 = np.arctan2(rd[1], rd[0])
        ar = ((a1 + np.pi) - (2 * ai))
        ray.setEnd(p1)
        dp = Point(np.cos(ar), np.sin(ar))
        ray = Ray(parent=ray, dir=dp)
    else:
        ray.setEnd(None)
    return [ray]
