自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

complex 中文man頁面

系統(tǒng)
complex - 基礎(chǔ)復(fù)數(shù)數(shù)學(xué),復(fù)數(shù)是一種形如 z = a + b*i,這里的 a 和 b 都是實(shí)數(shù)且 i = sqrt(-1),因此 i*i = -1。

名字

complex - 基礎(chǔ)復(fù)數(shù)數(shù)學(xué)

概要

#include <complex.h>

描述

復(fù)數(shù)是一種形如 z = a + b*i,這里的 a 和 b 都是實(shí)數(shù)且 i = sqrt(-1),因此 i*i = -1。
還存在其它表達(dá)這種數(shù)的方式。一個(gè)實(shí)數(shù)對(a, b) 被看作是水平面的一個(gè)點(diǎn),此時(shí)給定了 X 和 Y 軸值。相同的點(diǎn)也可以通過給定一個(gè)實(shí)數(shù)對 (r, phi) 來確定,此時(shí) r 是點(diǎn)到原點(diǎn) O 的距離,而 phi 是線 Oz 與 X 軸的夾角。如此 z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi))。

對 z = a+b*i 和 w= c+d*i 的基本操作定義如下:

加法: z+w = (a+c) + (b+d)*i
乘法: z*w = (a*c - b*d) + (a*d + b*c)*i
除法: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c - a*d)/(c*c + d*d))*i

幾乎所有的數(shù)學(xué)函數(shù)都有復(fù)數(shù)的對應(yīng)版本但卻有復(fù)數(shù)特有的函數(shù)。

示例

如果的你的 C 編譯器支持 C99 標(biāo)準(zhǔn)則它就可以與復(fù)數(shù)一些工作,此時(shí)需要鏈接 -lm 選項(xiàng)。虛單位使用 I 表示。

/* 檢測 exp(i * pi) == -1 */
#include <math.h> /* for atan */
#include <stdio.h>
#include <complex.h>

int
main(void)
{
    double pi = 4 * atan(1.0);
    double complex z = cexp(I * pi);
    printf("%f + %f * i\n", creal(z), cimag(z));
}

參看

cabs(3)、carg(3)、cexp(3)、cimag(3)、creal(3)

#p#

NAME

complex - basics of complex mathematics  

SYNOPSIS

#include <complex.h>  

DESCRIPTION

Complex numbers are numbers of the form z = a+b*i, where a and b are real numbers and i = sqrt(-1), so that i*i = -1.
There are other ways to represent that number. The pair (a,b) of real numbers may be viewed as a point in the plane, given by X- and Y-coordinates. This same point may also be described by giving the pair of real numbers (r,phi), where r is the distance to the origin O, and phi the angle between the X-axis and the line Oz. Now z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)).

The basic operations are defined on z = a+b*i and w = c+d*i as:

addition: z+w = (a+c) + (b+d)*i
multiplication: z*w = (a*c - b*d) + (a*d + b*c)*i
division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c - a*d)/(c*c + d*d))*i

Nearly all math function have a complex counterpart but there are some complex only functions.  

EXAMPLE

Your C-compiler can work with complex numbers if it supports the C99 standard. Link with -lm. The imaginary unit is represented by I.

/* check that exp(i*pi) == -1 */
#include <math.h>       /* for atan */
#include <complex.h>
main() {
        double pi = 4*atan(1);
        complex z = cexp(I*pi);
        printf("%f+%f*i\n", creal(z), cimag(z));
}

SEE ALSO

cabs(3), carg(3), cexp(3), cimag(3), creal(3)

責(zé)任編輯:韓亞珊 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 16:48:04

cal中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 17:21:47

chattr中文man

2011-08-11 17:27:20

charset中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-11 18:41:29

cpio中文man

2011-08-12 09:05:09

dd中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:03:57

du中文man

2011-08-12 10:20:02

echo中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號