diff --git a/dir_cc5d1005398dc97e68496b52c0cb5ac3.html b/dir_cc5d1005398dc97e68496b52c0cb5ac3.html index 12cb2f14..039cfb2f 100644 --- a/dir_cc5d1005398dc97e68496b52c0cb5ac3.html +++ b/dir_cc5d1005398dc97e68496b52c0cb5ac3.html @@ -125,12 +125,6 @@
complex Directory Reference
- - - - -

-Directories

directory  impl
 
diff --git a/group__complex_gac49e8cf76fe002ef3d3e480fb80217ff.html b/group__complex_gac49e8cf76fe002ef3d3e480fb80217ff.html index 126f967d..b36644f5 100644 --- a/group__complex_gac49e8cf76fe002ef3d3e480fb80217ff.html +++ b/group__complex_gac49e8cf76fe002ef3d3e480fb80217ff.html @@ -149,15 +149,22 @@

Callable Signatures

namespace eve
{
-
auto to_polar( auto q) const noexcept;
+
template<eve::ordered_value T> constexpr auto arg(T z) noexcept; //1
+
template<kyosu::concepts::complex T> constexpr auto atan(T z) noexcept; //2
+
template<kyosu::concepts::cayley_dickson T> constexpr auto argy(T z) noexcept; //3
}
-
constexpr tags::callable_to_polar to_polar
Callable object computing the polar coordinates from a complex.
Definition: to_polar.hpp:86
+
constexpr tags::callable_atan atan
Computes the inverse hyperbolic tangent of the argument.
Definition: atan.hpp:86
+
constexpr tags::callable_arg arg
complex number argument.
Definition: arg.hpp:79

Parameters

-

q : quaternion

+

q : cayley dickson value

Return value

-

a tuple containing in this order rho, 'theta': the modulus and the argument in radian of the complex input

+
    +
  1. a tuple containing rho, 'theta': the absolute value and the argument in radian of the real input ( \(0\) or \(\pi\)).
  2. +
  3. a tuple containing rho, 'theta': the modulus and the argument in radian of the complex input.
  4. +
  5. a tuple containing rho, 'theta' the modulus and the argument in radian of the cayley input and a square root of -1 iz such that z = rho*exp(iz*theta). The leading coefficient of ìz is chosen non-negative.`
  6. +

-

+

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
@@ -170,27 +177,64 @@

using e_t = float;
+
using we_t = eve::wide<float, eve::fixed<2>>;
using wc_t = eve::wide<kyosu::complex_t<float>, eve::fixed<2>>;
+
using wq_t = eve::wide<kyosu::quaternion_t<float>, eve::fixed<2>>;
+
using wq_t = eve::wide<kyosu::quaternion_t<float>, eve::fixed<2>>;
-
std::cout << "Real: "<< "\n";
-
e_t e0(1);
-
e_t e1(-2);
-
std::cout << e0 << " -> " << to_polar(e0) << "\n";
-
std::cout << e1 << " -> " << to_polar(e1) << "\n";
-
we_t we0(e0);
-
we_t we1(e1);
-
std::cout << we0 << " -> " << to_polar(we0) << "\n";
-
std::cout << we1 << " -> " << to_polar(we1) << "\n";
-
-
std::cout << "Complex: "<< "\n";
-
c_t c0(3, -4);
-
std::cout << c0 << " -> " << to_polar(c0) << "\n";
-
wc_t wc0(c0);
-
std::cout << wc0 << " -> " << to_polar(wc0) << "\n";
-
+
{
+
std::cout << "Real: "<< "\n";
+
e_t e0(1);
+
e_t e1(-2);
+
auto [r0, t0] = to_polar(e0);
+
std::cout << e0 << " -> r0 = " << r0 << ", t0 = " << t0 << "\n";
+
auto [r1, t1] = to_polar(e1);
+
std::cout << e1 << " -> r0 = " << r1 << ", t1 = " << t0 << "\n";
+
we_t we0(e0);
+
we_t we1(e1);
+
auto [wr0, wt0] = to_polar(we0);
+
std::cout << we0 << " -> r0 = " << wr0 << ", wt0 = " << wt0 << "\n";
+
auto [wr1, wt1] = to_polar(we1);
+
std::cout << we1 << " -> wr0 = " << wr1 << ", wt1 = " << wt0 << "\n";
+
}
+
{
+
std::cout << "Complex: "<< "\n";
+
c_t c0(3, -4);
+
c_t c1(1, 2);
+
auto [r0, t0] = to_polar(c0);
+
std::cout << c0 << " -> r0 = " << r0 << ", t0 = " << t0 << "\n";
+
auto [r1, t1] = to_polar(c1);
+
std::cout << c1 << " -> r0 = " << r1 << ", t1 = " << t0 << "\n";
+
wc_t wc0(c0, kyosu::sqr(c0));
+
wc_t wc1(c1, c0);
+
auto [wr0, wt0] = to_polar(wc0);
+
std::cout << wc0 << " -> r0 = " << wr0 << ", wt0 = " << wt0 << "\n";
+
auto [wr1, wt1] = to_polar(wc1);
+
std::cout << wc1 << " -> wr0 = " << wr1 << ", wt1 = " << wt0 << "\n";
+
}
+
{
+
std::cout << "Quaternion: "<< "\n";
+
q_t q0(3, -4, 2, -1);
+
auto [r, t, i] = to_polar(q0);
+
std::cout << "q0= " << q0<< std::endl;
+
std::cout << "r = " << r << std::endl;
+
std::cout << "t = " << t << std::endl;
+
std::cout << "i = " << i << std::endl;
+
std::cout << "r*exp(i*t) = " << r*kyosu::exp(i*t) << std::endl;
+
wq_t wq0(q0, q0*(1.0-q0));
+
auto [wr, wt, wi] = to_polar(wq0);
+
std::cout << "wq0= " << wq0<< std::endl;
+
std::cout << "wr = " << wr << std::endl;
+
std::cout << "wt = " << wt << std::endl;
+
std::cout << "wi = " << wi << std::endl;
+
std::cout << "wr*exp(wi*wt) = " << wr*kyosu::exp(wi*wt) << std::endl;
+
}
return 0;
}
+
constexpr tags::callable_to_polar to_polar
Callable object computing the polar coordinates from a complex.
Definition: to_polar.hpp:95
+
constexpr tags::callable_sqr sqr
Computes the square value.
Definition: sqr.hpp:72
+
constexpr tags::callable_exp exp
Computes the exponential of the argument.
Definition: exp.hpp:73
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27

diff --git a/group__complex_gad70670d8278d34dc0f0faf883a48eab8.html b/group__complex_gad70670d8278d34dc0f0faf883a48eab8.html index 9841144e..d4c2243c 100644 --- a/group__complex_gad70670d8278d34dc0f0faf883a48eab8.html +++ b/group__complex_gad70670d8278d34dc0f0faf883a48eab8.html @@ -149,16 +149,20 @@

Callable Signatures

namespace eve
{
-
auto from_polar( auto rho, auto theta) const noexcept;
+
template<eve::ordered_value T0, eve::ordered_value T1>,
+
auto from_polar( T0 rho, T1 theta) const noexcept; // 1
+
template<eve::ordered_value T0, eve::ordered_value T1, kyosu::concepts::cayley_dickson C>,
+
auto from_polar( T0 rho, T1 theta, C iz) const noexcept; // 2
}
-
constexpr tags::callable_from_polar from_polar
Callable object computing a complex from its polar coordinates.
Definition: from_polar.hpp:91
+
constexpr tags::callable_from_polar from_polar
Callable object computing a complex from its polar coordinates.
Definition: from_polar.hpp:102

Parameters

-

rho : modulus rho : argument.

+

rho : modulus. theta : argument. ‘iz’ : unitary cayley dickson value.

Return value

-

the complex number associated.

-
Note
: a negative rho is not an error but is treated as {-rho, theta+pi}.
-
-

+
    +
  1. the complex number rho*exp(i*theta).
  2. +
  3. the cayley_dickson value rho*exp(iz*theta).
  4. +
+

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
@@ -174,13 +178,19 @@

auto theta = eve::pio_3(eve::as<double>());
auto rho = 3.0;
+
auto iz0 = kyosu::sign(kyosu::quaternion(0., 1.));
+
auto iz1 = kyosu::sign(kyosu::quaternion(0., 1., 2., 3.));
std::cout << " <- theta = " << theta << std::endl;
std::cout << " <- rho = " << rho << std::endl;
-
std::cout << " -> " << kyosu::from_polar(theta, rho) << "\n";
+
std::cout << " -> " << from_polar(theta, rho) << "\n";
+
std::cout << " -> " << from_polar(theta, rho, iz0) << "\n";
+
std::cout << " -> " << from_polar(theta, rho, iz1) << "\n";
return 0;
}
+
constexpr tags::callable_sign sign
Computes tne normalized value z/abs(z) if z is not zero else 0.
Definition: sign.hpp:75
+
constexpr tags::callable_quaternion quaternion
Constructs a kyosu::quaternion.
Definition: to_quaternion.hpp:72
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27

diff --git a/group__functions.html b/group__functions.html index bf823ffa..5abadd08 100644 --- a/group__functions.html +++ b/group__functions.html @@ -136,20 +136,20 @@ constexpr tags::callable_abs kyosu::abs = {}  Computes the absolute value of the parameter.
  -constexpr tags::callable_acos kyosu::acos = {} - Computes the acosine of the argument.
-  +constexpr tags::callable_acos kyosu::acos = {} + Computes the acosine of the argument.
+  constexpr tags::callable_acosh kyosu::acosh = {} - Computes the acoshine of the argument.
+ Computes the inverse hyperbolic cosine of the argument.
  constexpr tags::callable_acospi kyosu::acospi = {}  Computes the arc cosine of the argument times \(\pi\).
  constexpr tags::callable_acot kyosu::acot = {} - Computes the acotine of the argument.
+ Computes the arc cotangent of the argument.
  constexpr tags::callable_acoth kyosu::acoth = {} - Computes the acothine of the argument.
+ Computes the inverse hyperbolic cotangent of the argument.
  constexpr tags::callable_acotpi kyosu::acotpi = {}  Computes the arc cotangent of the argument times \(\pi\).
@@ -157,9 +157,9 @@ constexpr tags::callable_acsc kyosu::acsc = {}  Computes the arccosecant of the argument.
  -constexpr tags::callable_acsch kyosu::acsch = {} - Computes the hyperbolic arccosecant of the argument.
-  +constexpr tags::callable_acsch kyosu::acsch = {} + Computes the inverse hyperbolic cosecant of the argument.
+  constexpr tags::callable_acscpi kyosu::acscpi = {}  Computes the arc cosecant of the argument times \(\pi\).
  @@ -175,9 +175,9 @@ constexpr tags::callable_asecpi kyosu::asecpi = {}  Computes the arc secant of the argument times \(\pi\).
  -constexpr tags::callable_asin kyosu::asin = {} - Computes the asinine of the argument.
-  +constexpr tags::callable_asin kyosu::asin = {} + Computes the arcsine of the argument.
+  constexpr tags::callable_asinh kyosu::asinh = {}  Computes the asinhine of the argument.
  @@ -185,11 +185,11 @@  Computes the arc sine of the argument times \(\pi\).
  constexpr tags::callable_atan kyosu::atan = {} - Computes the atanine of the argument.
+ Computes the inverse hyperbolic tangent of the argument.
  -constexpr tags::callable_atanh kyosu::atanh = {} - Computes the atanhine of the argument.
-  +constexpr tags::callable_atanh kyosu::atanh = {} + Computes the inverse hyperbolic tangent of the argument.
+  constexpr tags::callable_atanpi kyosu::atanpi = {}  Computes the arc tangent of the argument times \(\pi\).
  @@ -323,8 +323,8 @@ constexpr tags::callable_is_finite kyosu::is_finite = {}  test if the parameter is finite.
  -constexpr tags::callable_is_imag kyosu::is_imag = {} - test if the parameter is imag.
+constexpr tags::callable_is_pure kyosu::is_imag = {} + test if the parameter real part is zero.
  constexpr tags::callable_is_infinite kyosu::is_infinite = {}  test if the parameter is infinite.
@@ -353,6 +353,9 @@ constexpr tags::callable_is_not_real kyosu::is_not_real = {}  test if the parameter is not_real.
  +constexpr tags::callable_is_pure kyosu::is_pure = {} + test if the parameter is pure.
+  constexpr tags::callable_is_real kyosu::is_real = {}  test if the parameter is real.
  diff --git a/group__functions_ga013ae7a04bb6a995c81537ab9c4396b4.html b/group__functions_ga013ae7a04bb6a995c81537ab9c4396b4.html index 9019b921..dfcad214 100644 --- a/group__functions_ga013ae7a04bb6a995c81537ab9c4396b4.html +++ b/group__functions_ga013ae7a04bb6a995c81537ab9c4396b4.html @@ -151,7 +151,7 @@

template< floating_value P, typename ... Ts>
auto operator()(Ts ... zi ) const noexcept
! }
-
Main KYOSU namespace.
Definition: acos.hpp:14
+
Main KYOSU namespace.
Definition: beta.hpp:13

Parameters