std::acos(std::complex)
提供: cppreference.com
| ヘッダ <complex> で定義
|
||
| template< class T > complex<T> acos( const complex<T>& z ); |
(C++11以上) | |
複素数の値 z の複素数の逆余弦を計算します。 分岐切断は実軸に沿って区間 [−1 ; +1] の外側に存在します。
目次 |
[編集] 引数
| z | - | 複素数の値 |
[編集] 戻り値
エラーが発生しなければ、 z の複素数の逆余弦が返されます。 戻り値は実部が [0 ; ∞) で虚部が [−iπ ; iπ] の範囲内です。
[編集] エラー処理と特殊な値
Errors are reported consistent with math_errhandling
If the implementation supports IEEE floating-point arithmetic,
- std::acos(std::conj(z)) == std::conj(std::acos(z))
- If
zis(±0,+0), the result is(π/2,-0) - If
zis(±0,NaN), the result is(π/2,NaN) - If
zis(x,+∞)(for any finite x), the result is(π/2,-∞) - If
zis(x,NaN)(for any nonzero finite x), the result is(NaN,NaN)and FE_INVALID may be raised. - If
zis(-∞,y)(for any positive finite y), the result is(π,-∞) - If
zis(+∞,y)(for any positive finite y), the result is(+0,-∞) - If
zis(-∞,+∞), the result is(3π/4,-∞) - If
zis(+∞,+∞), the result is(π/4,-∞) - If
zis(±∞,NaN), the result is(NaN,±∞)(the sign of the imaginary part is unspecified) - If
zis(NaN,y)(for any finite y), the result is(NaN,NaN)and FE_INVALID may be raised - If
zis(NaN,+∞), the result is(NaN,-∞) - If
zis(NaN,NaN), the result is(NaN,NaN)
[編集] ノート
逆余弦は多値関数であり、複素平面上の分岐切断が要求されます。 分岐切断は慣習的に実軸上の線分 (-∞,-1) および (1,∞) に置かれます。
逆余弦の主値の数学的な定義は acos z =| 1 |
| 2 |
) です。
任意の z について、 acos(z) = π - acos(-z) が成り立ちます。
[編集] 例
Run this code
#include <iostream> #include <cmath> #include <complex> int main() { std::cout << std::fixed; std::complex<double> z1(-2, 0); std::cout << "acos" << z1 << " = " << std::acos(z1) << '\n'; std::complex<double> z2(-2, -0.0); std::cout << "acos" << z2 << " (the other side of the cut) = " << std::acos(z2) << '\n'; // for any z, acos(z) = pi - acos(-z) const double pi = std::acos(-1); std::complex<double> z3 = pi - std::acos(z2); std::cout << "cos(pi - acos" << z2 << ") = " << std::cos(z3) << '\n'; }
出力:
acos(-2.000000,0.000000) = (3.141593,-1.316958) acos(-2.000000,-0.000000) (the other side of the cut) = (3.141593,1.316958) cos(pi - acos(-2.000000,-0.000000)) = (2.000000,0.000000)
[編集] 関連項目
| (C++11) |
複素数の逆正弦 (arcsin(z)) を計算します (関数テンプレート) |
| (C++11) |
複素数の逆正接 (arctan(z)) を計算します (関数テンプレート) |
| 複素数の余弦 (cos(z)) を計算します (関数テンプレート) | |
| (C++11)(C++11) |
逆余弦 (arccos(x)) を計算します (関数) |
| valarray の各要素に関数 std::acos を適用します (関数テンプレート) | |
| cacos の C言語リファレンス
| |

