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// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_COMPLEX_SIN_HPP
5#define TETL_COMPLEX_SIN_HPP
6
7#include <etl/_complex/complex.hpp>
8#include <etl/_complex/sinh.hpp>
9
10namespace etl {
11
12/// \ingroup complex
13template <typename T>
14[[nodiscard]] constexpr auto sin(complex<T> const& z) -> complex<T>
15{
16 auto const x = z.real();
17 auto const y = z.imag();
18 return {
19 etl::sin(x) * etl::cosh(y),
20 etl::cos(x) * etl::sinh(y),
21 };
22}
23
24} // namespace etl
25
26#endif // TETL_COMPLEX_SIN_HPP
constexpr auto sin(complex< T > const &z) -> complex< T >
Definition sin.hpp:14
Definition adjacent_find.hpp:9
A complex number.
Definition complex.hpp:20