tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
arg.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_COMPLEX_ARG_HPP
4#define TETL_COMPLEX_ARG_HPP
5
10
11namespace etl {
12
14template <typename T>
15[[nodiscard]] constexpr auto arg(complex<T> const& z) noexcept -> T
16{
17 return etl::atan2(z.imag(), z.real());
18}
19
21template <floating_point Float>
22[[nodiscard]] constexpr auto arg(Float f) noexcept -> complex<Float>
23{
25}
26
28template <integral Integer>
29[[nodiscard]] constexpr auto arg(Integer i) noexcept -> complex<double>
30{
32}
33
34} // namespace etl
35
36#endif // TETL_COMPLEX_ARG_HPP
constexpr auto atan2(float x, float y) noexcept -> float
Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.
Definition atan2.hpp:15
constexpr auto arg(complex< T > const &z) noexcept -> T
Definition arg.hpp:15
Definition adjacent_find.hpp:8
A complex number.
Definition complex.hpp:19