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
6
#include <
etl/_cmath/atan2.hpp
>
7
#include <
etl/_complex/complex.hpp
>
8
#include <
etl/_concepts/floating_point.hpp
>
9
#include <
etl/_concepts/integral.hpp
>
10
11
namespace
etl
{
12
14
template
<
typename
T>
15
[[nodiscard]]
constexpr
auto
arg
(
complex<T>
const
& z)
noexcept
-> T
16
{
17
return
etl::atan2
(z.imag(), z.real());
18
}
19
21
template
<
float
ing_po
int
Float>
22
[[nodiscard]]
constexpr
auto
arg
(Float f)
noexcept
->
complex<Float>
23
{
24
return
etl::arg
(
etl::complex<Float>
(f));
25
}
26
28
template
<
int
egral Integer>
29
[[nodiscard]]
constexpr
auto
arg
(Integer i)
noexcept
->
complex<double>
30
{
31
return
etl::arg
(
etl::complex<double>
(i));
32
}
33
34
}
// namespace etl
35
36
#endif
// TETL_COMPLEX_ARG_HPP
complex.hpp
atan2.hpp
floating_point.hpp
etl::atan2
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
etl::arg
constexpr auto arg(complex< T > const &z) noexcept -> T
Definition
arg.hpp:15
integral.hpp
etl
Definition
adjacent_find.hpp:8
etl::complex
A complex number.
Definition
complex.hpp:19
include
etl
_complex
arg.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0