Computing: Free Pascal Programming

Roots of a complex number.


Download cplxroots desktop application (Windows 64bit) Download cplxroots source code (Lazarus/Free Pascal)

Description: The program determines all nth roots of a complex number (and as real numbers are a subset of complex numbers, all nth roots of a real number). The complex may be entered either in Cartesian, polar or exponential form. As may be the display of the roots. The user may also choose the number of decimal digits of the root values displayed.
The complex is read in by either entering its real and imaginary part (Cartesian form), or the modulus and the angle in radians (polar and exponential form). The standard output form is a formatted Cartesian form, for example displaying 1 + 0i as 1, or 0 - 1i as -i. The complex and root form and the number of decimal digits are kept during calculations; you may however change them (without restarting the program) by pushing the R (reset all) or F (form) keys, after a calculation has been done. ESC terminates the program, all other keys, except those used to change the settings, continue the program with the next calculation.

Free Pascal features: Functions of the math unit. Complex number calculations. Number input with numeric-checking and default value. Decision making on keystroke.

Screenshots:

Complex roots determination: Input of the complex number
 
Complex roots determination: Display of the roots