pynitride.core.maths module¶
- pynitride.core.maths.cart2polar(x, y)¶
Converts a Cartesian x,y coordinate to a polar rho,theta coordinate.
Arguments x and y can be scalars/arrays/anything that numpy accepts. Normal broadcasting rules apply.
- Parameters:
x – x coordinate
y – y coordinate
- Returns:
tuple of (rho, theta)
- pynitride.core.maths.chunks(lst, n)¶
Yield successive n-sized chunks from lst.
- pynitride.core.maths.dephase(vec)¶
- pynitride.core.maths.double_mat(arr, dtype='complex')¶
- pynitride.core.maths.polar2cart(rho, theta)¶
Converts a polar rho,theta coordinate to a Cartesian x,y coordinate.
Arguments rho and theta can be scalars/arrays/anything that numpy accepts. Normal broadcasting rules apply.
- Parameters:
rho – radial coordinate
theta – angular coordinate in radians
- Returns:
tuple of (x, y)
- pynitride.core.maths.round_near(arr, ival)¶