Quantitative Spatial Functions – sc2qsr.spatial.quantitative

sc2qsr.spatial.quantitative.cart2pol(x: float, y: float) → tuple[source]

Convert cartesian coordinates to polar

Parameters
  • x (float) – cartesian coordinate in the X direction

  • y (float) – cartesian coordinate in the Y direction

Returns

a tuple containing the euclidean distance of point (x,y) and its angle in radians, w.r.t. to the origin

Return type

tuple

sc2qsr.spatial.quantitative.pol2cart(rho: float, phi: float) → tuple[source]

Convert polar coordinates to cartesian

Parameters
  • rho (float) – distance of the point to the origin

  • phi (float) – angle of the point wrt. to the origin

Returns

a tuple containing the (x,y) coordinates of the point w.r.t. the origin

Return type

tuple