GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
M_COMPLEX(3) FreeBSD Library Functions Manual M_COMPLEX(3)

M_ComplexAgar-Math complex number

#include <agar/core.h>
#include <agar/gui.h>
#include <agar/math/m.h>

The M_Complex object describes a complex number (without requiring an ISO C90 compiler). It is a simple structure defined as:

typedef struct m_complex {
	M_Real r;    /* Real part */
	M_Real i;    /* "Imaginary" part */
} M_Complex;

M_Complex
(M_Real r, M_Real i);


M_Complex
(AG_DataSource *ds);


void
(AG_DataSource *ds, M_Complex *z);


void
(AG_DataSource *ds, M_Complex z);

The () routine returns a M_Complex structure describing a complex number with real part r and imaginary part i.

() returns the complex number for i. () returns the complex number for -i.

The () function reads a complex number from an AG_DataSource(3) and returns it. M_CopyComplex() returns the number in z. M_WriteComplex() writes a complex number to a data source.

M_Real
M_ComplexReal(M_Complex z);


M_Real
(M_Complex z);


M_Real
(M_Complex z);


M_Real
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


void
(M_Complex z, M_Real *r, M_Real *theta);

The () routine extracts and return the real part of complex number z. M_ComplexImag() returns the imaginary part.

() returns the modulus of z, which is computed as sqrt(r^2 + i^2). M_ComplexArg() returns the argument of z, computed as atan2(i,r);

() returns the additive inverse of z.

() returns the multiplicative inverse of z.

() returns the polar form of z into r (corresponding to the modulus) and theta (corresponding to the argument).

M_Complex
M_ComplexAdd(M_Complex a, M_Complex b);


M_Complex
(M_Complex a, M_Complex b);


M_Complex
(M_Complex a, M_Complex b);


M_Complex
(M_Complex a, M_Complex b);


M_Real
(M_Complex z);

The () routine returns the sum of complex numbers a and b. M_ComplexSub() returns the difference.

() computes the product of complex numbers a and b. M_ComplexDiv() divides a by b and returns the result.

The () function computes the complex absolute value (i.e., sqrt(r^2 + i^2)). If the magnitude of either real or imaginary parts differs with zero up to 50% of machine precision, both parts are rescaled prior to squaring.

() computes the complex square root of z.

() computes the complex natural logarithm of z.

() computes the exponential of z.

() returns a raised to the complex power z.

M_Complex
M_ComplexSin(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);


M_Complex
(M_Complex z);

The () function returns the complex sine of z. M_ComplexCos() returns the complex cosine, M_ComplexTan() returns the complex tangent and M_ComplexCot() returns the complex cotangent.

(), M_ComplexAcos() and M_ComplexAtan() compute the complex arc sine, arc cosine and arc tangent of z, respectively.

(), M_ComplexAsinh(), M_ComplexCosh(), M_ComplexAcosh(), M_ComplexTanh(), M_ComplexAtanh() compute the complex hyperbolic sine, arc sine, cosine, arc cosine, tangent and arc tangent of z, respectively.

AG_DataSource(3), AG_Intro(3), M_Matrix(3), M_Quaternion(3), M_Real(3), M_Vector(3)

The M_Complex structure first appeared in Agar 1.3.4.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.