SRL Archive - Help

Complex Numbers (Using Units)?


fiveten

2012-06-16 14:31:09

I am new to Simba, SRL, Free Pascal, and this forum, so I hope this is the correct section for my post.

I was searching google and found a unit for Free Pascal called ucomplex which should work for what I need, but I am not sure how to include it into my script. I know I could just write my own class which holds both real and imaginary parts of the number and overload the operators. In fact, this site explains it very well, but my question concerns including these units into my script.

http://wiki.freepascal.org/Unit_categorization

I have tried this script but it fails to compile on the "uses UCOMPLEX" line:


program CmplxDemo;
uses UCOMPLEX;
var
z: Complex;
begin
z := Cmplx (13, 37) { z := x + iy }
end.

Sin

2012-06-16 14:32:52

It looks similar to a TPoint.

Brandon

2012-06-16 15:27:36

Copy all your unit stuff into a .Simba file. do {$I LocationOfSimbaFile.Simba}

edit anything that may need converting to compile.

How in the world does this look like TPoints.. -__-