tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
sinh.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_SINH_HPP
5#define TETL_COMPLEX_SINH_HPP
6
7#include <etl/_cmath/cos.hpp>
8#include <etl/_cmath/cosh.hpp>
9#include <etl/_cmath/sin.hpp>
10#include <etl/_cmath/sinh.hpp>
11#include <etl/_complex/complex.hpp>
12
13namespace etl {
14
15/// \ingroup complex
16template <typename T>
17[[nodiscard]] constexpr auto sinh(complex<T> const& z) -> complex<T>
18{
19 auto const x = z.real();
20 auto const y = z.imag();
21 return {
22 etl::sinh(x) * etl::cos(y),
23 etl::cosh(x) * etl::sin(y),
24 };
25}
26
27} // namespace etl
28
29#endif // TETL_COMPLEX_SINH_HPP
constexpr auto sinh(complex< T > const &z) -> complex< T >
Definition sinh.hpp:17
Definition adjacent_find.hpp:9
A complex number.
Definition complex.hpp:20