tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
sin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_COMPLEX_SIN_HPP
4#define TETL_COMPLEX_SIN_HPP
5
8
9namespace etl {
10
12template <typename T>
13[[nodiscard]] constexpr auto sin(complex<T> const& z) -> complex<T>
14{
15 auto const x = z.real();
16 auto const y = z.imag();
17 return {
18 etl::sin(x) * etl::cosh(y),
19 etl::cos(x) * etl::sinh(y),
20 };
21}
22
23} // namespace etl
24
25#endif // TETL_COMPLEX_SIN_HPP
constexpr auto sinh(float arg) noexcept -> float
Computes the hyperbolic sine of arg.
Definition sinh.hpp:14
constexpr auto cos(float arg) noexcept -> float
Computes the cosine of arg (measured in radians).
Definition cos.hpp:44
constexpr auto sin(float arg) noexcept -> float
Computes the sine of arg (measured in radians).
Definition sin.hpp:44
constexpr auto cosh(float arg) noexcept -> float
Computes the hyperbolic cosine of arg.
Definition cosh.hpp:16
Definition adjacent_find.hpp:8
A complex number.
Definition complex.hpp:19