#NEWLINE# def spherical_to_cartesian( r , theta , phi ) : #NEWLINE# #INDENT# '\n    Convert spherical coordinates to cartesian coordinates.\n    \n    :param r: norm\n    :param theta: angle :math:`\\theta`\n    :param phi: angle :math:`\\phi`\n    \n    .. math:: x = r \\sin{\\theta}\\cos{\\phi}\n    .. math:: y = r \\sin{\\theta}\\sin{\\phi}\n    .. math:: z = r \\cos{\\theta}\n    ' #NEWLINE# r = np . asanyarray ( r ) #NEWLINE# theta = np . asanyarray ( theta ) #NEWLINE# phi = np . asanyarray ( phi ) #NEWLINE# return ( ( ( r * np . sin ( theta ) ) * np . cos ( phi ) ) , ( ( r * np . sin ( theta ) ) * np . sin ( phi ) ) , ( r * np . cos ( theta ) ) )