RTL referenceGlossaryTips/TricksFREE App/VCLBooksLink Back 
TComplexMath  
When using Delphi to develop engineering applications, you'll often find that the mathematics support in the development environment is not enough. TComplexMath unit is a way out! Full source code.  
Article submitted by: Thomas Bejstam for the Delphi Programming Quickies Contest. Complex MathematicsWhen using Delphi to develop engineering applications, you'll often find that the mathematics support in the development environment is not enough. So, what's the way out?I was dealing with impedances on transmission lines, and the basic formulas for this can be found in most textbooks on the subject. However, the mathematics requires complex capabilities, and I decided to write my own component to support this, TComplexMath. All complex number has a real and an imaginary part. Therefore the most logical implementation was to use a record, consisting of two real type variables, one for the real part and one for the imaginary part. The rules for complex mathematics are not any different than those for noncomplex mathematics. I actually prefer to see the "normal" noncomplex math as a special case. Try using the complex math routines with real numbers (zero imaginary part), and you'll come up with familiar results. Very simple! Some properties that can be applied to real numbers, e.g. larger than, smaller than, etc., does not exist for complex numbers, since a complex number is not defined by its size. I hope this component will turn out useful to you. Go complex! Download full source code! 
All graphics (if any) in this feature created by Zarko Gajic.
More Delphi 
· Learn another routine every day  RTL Quick Reference. · Download free source code applications and components. · Talk about Delphi Programming, real time. · Link to the Delphi Programming site from your Web pages. · Tutorials, articles, tech. tips by date: 200320022001200019991998 or by TOPIC. 
Stay informed with all new and interesting things about Delphi (for free). 

Got some code to share? Got a question? Need some help? 