carg

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

carg, cargf, cargl - 複素数の偏角を計算する  

ライブラリ

数学ライブラリ (libm,~-lm)  

書式

#include <complex.h>

double carg(double complex z);
float cargf(float complex z);
long double cargl(long double complex z);
 

説明

これらの関数は、 z の複素引数 (位相角とも呼ばれる) を計算する。実軸の負の部分に沿って分枝切断 (branch cut) がある)。

複素数は 2つの実数値からなる座標で表すことができる。 直交座標を使うと、以下のように書くことができる。

z = x + I * y

where x~=~creal(z) and y~=~cimag(z).

また、極座標を使うと、以下のように書くことができる。

z = r * cexp(I * a)

where r~=~cabs(z) is the "radius", the "modulus", the absolute value of z, and a~=~carg(z) is the "phase angle", the argument of z.

次の関係が成立する:

tan(carg(z)) = cimag(z) / creal(z)
 

返り値

返り値は [-pi,pi] の範囲である。  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
carg(), cargf(), cargl() Thread safetyMT-Safe
 

標準規格

C11, POSIX.1-2008.  

歴史

glibc 2.1. C99, POSIX.1-2001.  

関連項目

cabs(3), complex(7)


 

Index

名前
ライブラリ
書式
説明
返り値
属性
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.