import numpy as np
import winkelumrechnungen as wu


def arccot(x):
    return np.arctan2(1.0, x)


def cot(a):
    return np.cos(a) / np.sin(a)


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))))
