Complex number class

Complex number class

Released 4 years ago , Last update 4 years ago

Complex number class

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+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();

CComplex  Coniugate ,Reciprocal;

// coniugate and reciprocals

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

// modulus and phase

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


14-day money-back guarantee


Personal License

  • Perpetual license

  • 1 application

  • Can distribute binary products only

  • Commercial use

1 license From » $4.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

Or enter your name and Email
No comments have been posted yet.