import math


def fromSpherical(r, theta, phi):
    """ convert spherical coordinates to 3-d cartesian coordinates """
    return r*math.sin(theta)*math.cos(phi), r*math.sin(theta)*math.sin(phi), r*math.cos(theta)