This commit is contained in:
2026-02-10 21:10:11 +01:00
parent db05f7b6db
commit 1fbfb555a4
9 changed files with 158 additions and 114 deletions

View File

@@ -1,4 +1,5 @@
import numpy as np
import winkelumrechnungen as wu
def arccot(x):
@@ -9,5 +10,19 @@ def cot(a):
return np.cos(a) / np.sin(a)
def wrap_to_pi(x):
def wrap_mpi_pi(x):
return (x + np.pi) % (2 * np.pi) - np.pi
def wrap_mhalfpi_halfpi(x):
return (x + np.pi / 2) % np.pi - np.pi / 2
def wrap_0_2pi(x):
return x % (2 * np.pi)
if __name__ == "__main__":
print(wu.rad2deg(wrap_mhalfpi_halfpi(wu.deg2rad(181))))
print(wu.rad2deg(wrap_0_2pi(wu.deg2rad(181))))
print(wu.rad2deg(wrap_mpi_pi(wu.deg2rad(181))))