ルジャンドル形式の第1種楕円積分

C言語によるサンプルソースコード : 使用関数名:nag_elliptic_integral_F (s21bec)

ホーム > 製品 > nAG数値計算ライブラリ > サンプルソースコード集 > ルジャンドル形式の第1種楕円積分 (C言語/C++)

Keyword: ルジャンドル形式, 第1種楕円積分

概要

本サンプルはルジャンドル形式の第1種楕円積分を求めるC言語によるサンプルプログラムです。 本サンプルは以下に示される第1種楕円積分を求めて出力します。

第1種楕円積分のデータ 

※本サンプルはnAG Cライブラリに含まれる関数 nag_elliptic_integral_F() のExampleコードです。本サンプル及び関数の詳細情報は nag_elliptic_integral_F のマニュアルページをご参照ください。
ご相談やお問い合わせはこちらまで

出力結果

(本関数の詳細はnag_elliptic_integral_F のマニュアルページを参照)
1
2
3
4
5
6
7

この出力例をダウンロード
nag_elliptic_integral_F (s21bec) Example Program Results

    phi    dm       nag_elliptic_integral_F

   0.52   0.25      0.5294
   1.05   0.50      1.1424
   1.57   0.75      2.1565

  • 3~7行目にプログラムで生成した引数Φ、mの値と第1種楕円積分の値が出力されています。

ソースコード

(本関数の詳細はnag_elliptic_integral_F のマニュアルページを参照)

※本サンプルソースコードはnAG数値計算ライブラリ(Windows, Linux, MAC等に対応)の関数を呼び出します。
サンプルのコンパイル及び実行方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

このソースコードをダウンロード
/* nag_elliptic_integral_F (s21bec) Example Program.
 *
 * CLL6I261D/CLL6I261DL Version.
 *
 * Copyright 2017 Numerical Algorithms Group.
 *
 * Mark 26.1, 2017.
 */
/* Pre-processor includes */
#include <stdio.h>
#include <nag.h>
#include <nag_stdlib.h>
#include <nags.h>
#include <nagx01.h>

int main(void)
{
  /*Integer scalar and array declarations */
  Integer exit_status = 0;
  Integer ix;
  /*Double scalar and array declarations */
  double dm, f, phi, pi;
  NagError fail;

  INIT_FAIL(fail);

  printf("%s\n", "nag_elliptic_integral_F (s21bec) Example Program Results");
  printf("\n");
  printf("%s\n", "    phi    dm       nag_elliptic_integral_F");
  printf("\n");
  pi = nag_pi;
  for (ix = 1; ix <= 3; ix++) {
    phi = ix * pi / 6.00e0;
    dm = ix * 0.250e0;
    /*
     * nag_elliptic_integral_F (s21bec)
     * Elliptic integral of 1st kind, Legendre form, F( phi |m)
     */
    f = nag_elliptic_integral_F(phi, dm, &fail);
    if (fail.code != NE_NOERROR) {
      printf("Error from nag_elliptic_integral_F (s21bec).\n%s\n",
             fail.message);
      exit_status = 1;
      goto END;
    }
    printf("%7.2f%7.2f%12.4f\n", phi, dm, f);
  }

END:

  return exit_status;
}


関連情報
© 日本ニューメリカルアルゴリズムズグループ株式会社 2025
Privacy Policy  /  Trademarks