std::ellint_3, std::ellint_3f, std::ellint_3l
定義於標頭檔案 <cmath> |
||
(1) | ||
float ellint_3 ( float k, float nu, float phi ); double ellint_3 ( double k, double nu, double phi ); |
(C++17 起) (直至 C++23) |
|
/* floating-point-type */ ellint_3( /* floating-point-type */ k, /* floating-point-type */ nu, |
(C++23 起) | |
float ellint_3f( float k, float nu, float phi ); |
(2) | (C++17 起) |
long double ellint_3l( long double k, long double nu, long double phi ); |
(3) | (C++17 起) |
定義於標頭檔案 <cmath> |
||
template< class Arithmetic1, class Arithmetic2, class Arithmetic3 > /* common-floating-point-type */ |
(A) | (C++17 起) |
目錄 |
[編輯] 引數
k | - | 橢圓模或離心率(浮點或整數值) |
nu | - | 橢圓特徵(浮點或整數值) |
phi | - | 雅可比幅角(浮點或整數值,以弧度測量) |
[編輯] 返回值
如果沒有錯誤發生,則返回 k、nu 和 phi 的第三類不完全橢圓積分值,即 ∫phi0
dθ |
(1-nusin2 θ)√1-k2 sin2 θ |
[編輯] 錯誤處理
錯誤可能按 math_errhandling 中指定的方式報告
- 如果引數是 NaN,則返回 NaN 且不報告域錯誤。
- 如果 |k|>1,可能會發生域錯誤。
[編輯] 注意
不支援 C++17 但支援 ISO 29124:2010 的實現,如果實現將 __STDCPP_MATH_SPEC_FUNCS__
定義為至少 201003L 的值,並且使用者在包含任何標準庫標頭檔案之前定義了 __STDCPP_WANT_MATH_SPEC_FUNCS__
,則會提供此函式。
不支援 ISO 29124:2010 但支援 TR 19768:2007 (TR1) 的實現,在標頭檔案 tr1/cmath
和名稱空間 std::tr1
中提供此函式。
此函式的一個實現也可在 boost.math 中找到。
不需要嚴格按照 (A) 提供額外的過載。它們只需要足以確保對於它們的第一個引數 num1、第二個引數 num2 和第三個引數 num3
|
(直至 C++23) |
如果 num1、num2 和 num3 具有算術型別,則 std::ellint_3(num1, num2, num3) 的效果與 std::ellint_3(static_cast</* common-floating-point-type */>(num1), 如果不存在具有最高等級和次等級的浮點型別,則過載決議不會從提供的過載中產生可用的候選函式。 |
(C++23 起) |
[編輯] 示例
#include <cmath> #include <iostream> #include <numbers> int main() { const double hpi = std::numbers::pi / 2; std::cout << "Π(0,0,π/2) = " << std::ellint_3(0, 0, hpi) << '\n' << "π/2 = " << hpi << '\n'; }
輸出
Π(0,0,π/2) = 1.5708 π/2 = 1.5708
本節不完整 原因:這個和其他橢圓積分都值得更好的例子……也許可以計算橢圓弧長? |
[編輯] 另請參閱
(C++17)(C++17)(C++17) |
(完全)第三類橢圓積分 (函式) |
[編輯] 外部連結
Weisstein, Eric W. "第三類橢圓積分。" 來自 MathWorld — Wolfram Web 資源。 |