bsfit.nodes.cirpy.utils.get_polar_to_cartesian¶
- bsfit.nodes.cirpy.utils.get_polar_to_cartesian(angle: numpy.ndarray, radius: float, type: str) dict [source]¶
convert angle in degree or radian to cartesian coordinates
- Parameters
angle (np.ndarray) – angles in degree or radian
radius (float) – radius
type (str) – “polar” or “radian”
- Usage:
import numpy as np from bsfit.nodes.cirpy.utils import get_polar_to_cartesian degree = np.array([0, 90, 180, 270]) cartesian = get_polar_to_cartesian(degree, 1, "polar") cartesian.keys() # Out: dict_keys(['deg', 'rad', 'cart']) cartesian["cart"] # Out: array([[ 1., 0.], # [ 0., 1.], # [-1., 0.], # [-0., -1.]])
- Returns
_description_
- Return type
dict