0 / 0 / 0
Регистрация: 07.02.2011
Сообщений: 13
|
|
1 | |
Комплексные числа07.02.2011, 13:47. Показов 1631. Ответов 4
Метки нет (Все метки)
Здравствуйте! Как мне в С написать вычисление следующего значения R(коэффициент прохождения):
l=exp(i*ky1*(-d)); j=i*ky1*(1-d); R=(exp(i*ky1*(y-d)-(d*l)/j)/(exp(i*ky1*(y-d)+(d*l)/j))); где i-это мнимая единица, ky1,d,y-константы
0
|
07.02.2011, 13:47 | |
Ответы с готовыми решениями:
4
Комплексные числа Комплексные числа Комплексные числа Комплексные числа |
программист С++
860 / 600 / 147
Регистрация: 19.12.2010
Сообщений: 2,014
|
|
07.02.2011, 14:45 | 2 |
создать структуру и перегрузить соотв. операции
0
|
0 / 0 / 0
Регистрация: 07.02.2011
Сообщений: 13
|
|
07.02.2011, 15:29 [ТС] | 3 |
А можешь показать примеры как создавать структуры или где можно посмотреть/найти.
Может быть учебник.)
0
|
5828 / 3479 / 358
Регистрация: 08.02.2010
Сообщений: 7,448
|
|
07.02.2011, 15:46 | 4 |
Мануалы
man complex:
Код
COMPLEX(7) Linux Programmer's Manual COMPLEX(7) 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 <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)); } SEE ALSO cabs(3), carg(3), cexp(3), cimag(3), creal(3) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at [url]http://www.kernel.org/doc/man-pages/[/url]. 2009-07-25 COMPLEX(7) Код
CABS(3) Linux Programmer's Manual CABS(3) NAME cabs, cabsf, cabsl - absolute value of a complex number SYNOPSIS #include <complex.h> double cabs(double complex z); float cabsf(float complex z); long double cabsl(long double complex z); Link with -lm. DESCRIPTION The cabs() function returns the absolute value of the complex number z. The result is a real number. VERSIONS These functions first appeared in glibc in version 2.1. CONFORMING TO C99. NOTES The function is actually an alias for hypot(a, b) (or, equivalently, sqrt(a*a + b*b)). SEE ALSO abs(3), cimag(3), hypot(3), complex(7) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 CABS(3) Код
CARG(3) Linux Programmer's Manual CARG(3) NAME carg, cargf, cargl - calculate the argument SYNOPSIS #include <complex.h> double carg(double complex z); float cargf(float complex z); long double cargl(long double complex z); Link with -lm. DESCRIPTION A complex number can be described by two real coordinates. One may use rectangular coordinates and gets z = x + I * y where x = creal(z) and y = cimag(z). Or one may use polar coordinates and gets 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. One has: tan(carg(z)) = cimag(z) / creal(z) RETURN VALUE The return value is the range of [-pi,pi]. VERSIONS These functions first appeared in glibc in version 2.1. CONFORMING TO C99. SEE ALSO cabs(3), complex(7) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 CARG(3) Код
CEXP(3) Linux Programmer's Manual CEXP(3) NAME cexp, cexpf, cexpl - complex exponential function SYNOPSIS #include <complex.h> double complex cexp(double complex z); float complex cexpf(float complex z); long double complex cexpl(long double complex z); Link with -lm. DESCRIPTION The function calculates e (2.71828..., the base of natural logarithms) raised to the power of z. One has: cexp(I * z) = ccos(z) + I * csin(z) VERSIONS These functions first appeared in glibc in version 2.1. CONFORMING TO C99. SEE ALSO cabs(3), clog(3), cpow(3), complex(7) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 CEXP(3) Код
CREAL(3) Linux Programmer's Manual CREAL(3) NAME creal, crealf, creall - get real part of a complex number SYNOPSIS #include <complex.h> double creal(double complex z); float crealf(float complex z); long double creall(long double complex z); Link with -lm. DESCRIPTION The creal() function returns the real part of the complex number z. One has: z = creal(z) + I * cimag(z) VERSIONS These functions first appeared in glibc in version 2.1. CONFORMING TO C99. NOTES The gcc supports also __real__. That is a GNU extension. SEE ALSO cabs(3), cimag(3), complex(7) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 CREAL(3) Код
CIMAG(3) Linux Programmer's Manual CIMAG(3) NAME cimag, cimagf, cimagl - get imaginary part of a complex number SYNOPSIS #include <complex.h> double cimag(double complex z); float cimagf(float complex z); long double cimagl(long double complex z); Link with -lm. DESCRIPTION The cimag() function returns the imaginary part of the complex number z. One has: z = creal(z) + I * cimag(z) VERSIONS These functions first appeared in glibc in version 2.1. CONFORMING TO C99. NOTES gcc also supports __imag__. That is a GNU extension. SEE ALSO cabs(3), creal(3), complex(7) COLOPHON This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 CIMAG(3) Необходима хотя бы частичная поддержка компилятором стандарта C99
0
|
5055 / 3115 / 271
Регистрация: 11.11.2009
Сообщений: 7,044
|
|
07.02.2011, 16:04 | 5 |
0
|
07.02.2011, 16:04 | |
07.02.2011, 16:04 | |
Помогаю со студенческими работами здесь
5
Комплексные числа Комплексные числа Комплексные числа Комплексные числа Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |