命名空间
变体
操作

std::ellint_3, std::ellint_3f, std::ellint_3l

来自 cppreference.cn
< cpp‎ | 数值‎ | 特殊函数
 
 
 
 
定义于头文件 <cmath>
(1)
float       ellint_3 ( float k, float nu, float phi );

double      ellint_3 ( double k, double nu, double phi );

long double ellint_3 ( long double k, long double nu, long double phi );
(C++17 起)
(直至 C++23)
/* floating-point-type */ ellint_3( /* floating-point-type */ k,

                                    /* floating-point-type */ nu,

                                    /* floating-point-type */ phi );
(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 */

    ellint_3( Arithmetic1 k, Arithmetic2 nu, Arithmetic3 phi );
(A) (C++17 起)
1-3) 计算 knuphi第三类不完全椭圆积分 库为所有 cv 非限定浮点类型提供了 std::ellint_3 的重载,作为参数 knuphi 的类型。(C++23 起)
A) 为所有其他算术类型组合提供了附加重载。

目录

[编辑] 参数

k - 椭圆模或离心率(浮点或整数值)
nu - 椭圆特征(浮点或整数值)
phi - 雅可比幅角(浮点或整数值,以弧度测量)

[编辑] 返回值

如果没有错误发生,则返回 knuphi 的第三类不完全椭圆积分值,即 phi
0
(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

  • 如果 num1num2num3 的类型为 long double,则 std::ellint_3(num1, num2, num3) 的效果与 std::ellint_3(static_cast<long double>(num1),
                  static_cast<long double>(num2),
                  static_cast<long double>(num3))
    相同。
  • 否则,如果 num1num2 和/或 num3 的类型为 double 或整数类型,则 std::ellint_3(num1, num2, num3) 的效果与 std::ellint_3(static_cast<double>(num1),
                  static_cast<double>(num2),
                  static_cast<double>(num3))
    相同。
  • 否则,如果 num1num2num3 的类型为 float,则 std::ellint_3(num1, num2, num3) 的效果与 std::ellint_3(static_cast<float>(num1),
                  static_cast<float>(num2),
                  static_cast<float>(num3))
    相同。
(直至 C++23)

如果 num1num2num3 具有算术类型,则 std::ellint_3(num1, num2, num3) 的效果与 std::ellint_3(static_cast</* common-floating-point-type */>(num1),
              static_cast</* common-floating-point-type */>(num2),
              static_cast</* common-floating-point-type */>(num3))
相同,其中 /* common-floating-point-type */num1num2num3 的类型中浮点转换等级最高且浮点转换子等级最高的浮点类型,整数类型参数被视为具有与 double 相同的浮点转换等级。

如果不存在具有最高等级和次等级的浮点类型,则重载决议不会从提供的重载中产生可用的候选函数。

(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

[编辑] 另请参阅

(完全)第三类椭圆积分
(函数) [编辑]

[编辑] 外部链接

Weisstein, Eric W. "第三类椭圆积分。" 来自 MathWorld — Wolfram Web 资源。