Personal License $4.99

1 application Binary restricted distribution Commercial use allowed Can modify source Read full license | More Info

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Price: $ 4.99

View Pricing 14 days money-back guarantee

Complex number class

Complex number class

Share and win up to $15k in prizes each month!Learn more

Share

Description

Complex numbers are of vital importance in engeneering, physics and math, also many topics on game development , require understanding of complex number field of application. The class is a single .h file The class implements templated overloaded operators, an exaple of usage is as follows:

// declaration
CComplex a(1,2),b(2,4) ,c(3,2),d(1,1),e(2,2);

//Arithmetics :

a=-b; 
a=+b;
a= b+c;
a= 10.0f / b ;
a= b / 10.0f ;
b = a * 10.0f;
b+=c ;
b/= c *10.0f;
a = b * c ;
b = c/ b ;
a = b+c +d +e ;
// get real and immaginary part

float r = a.GetReal();
float i= a.GetIm();

// get real and immaginary part in trigonometric form

r= a.GetRealTrigForm();
i=b.GetImTrigForm();

CComplex  Coniugate ,Reciprocal;

// coniugate and reciprocals

Coniugate= a.GetConiugate();
Reciprocal = a. GetReciprocal();

// modulus and phase

float m  = b.GetModulus();
float ph = c.GetPhase();

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.

User Reviews

No reviews have been submitted yet.

Price: $ 4.99

View Pricing 14 days money-back guarantee