This calculator is written as a demo application for the SCI library. It has a similar interface to the Windows built-in calculator (Standard View) and it can handle complex numbers as operands. Complex Calculator is a more general-purpose and usable calculator.
The interface of Complex Calculator
- Display: Outputs the results of calculations and current number inputs.
- Input: Buttons for inputting digits and calculation operations.
Use of Sci.Math.ComplexNumber
The manipulation of complex numbers is powered by
Sci.Math.ComplexNumber is implemented using the following structure:
Sci.Math.ComplexNumber z = new Sci.Math.ComplexNumber();
z represents 0+i0. We can change the Real part or the Imaginary part of
z.Re = 3;
z.Im = 4;
ComplexNumber supports Addition, Subtraction, Multiplication and Division. For instance:
Sci.Math.ComplexNumber w = new Sci.Math.ComplexNumber(1, 2);
w = w + z;
w represents 4+i6. Calculations of the modulus and argument of
z can be retrieved from the properties
double m = z.Modulus;
double a = z.Argument;
Although this "Complex" Calculator is not truly complex, its intent is to enable users who use complex numbers to quickly get answers from basic operations for complex numbers. Many scientific software developers also know of the SCI library.
- 4 April, 2007 -- Version 220.127.116.11
- 26 June, 2007 -- Article edited and moved to the main CodeProject.com article base