use of libertybasic
- On 3/30/2013 11:49 AM, phil wrote:
> please - has anyone found a way to use complewx numbers in liberty basic ?I've never see a BASIC that had complex arithmetic built in. Then of
> thanks - phil geffe
course, I have seen only a handful of BASIC's, Liberty being the last.
In all the other cases, I had to write functions and subroutines to do
the arithmetic ...
function mag(rx, ix)
where rx is the real part and ix is the imaginary part. mag is a real
of course. In languages where you can pass vectors, the above would become
I have no idea if that will work in LB.
Same with linear algebra ...
Also true of FORTRAN, and many other ancient languages.
It's been a LONG time since I thought about SQRT(-1), but IIRC, complex
numbers worked the same as real numbers -- you just have to handle the
real and imaginary components separately.
LB doesn't have built-in facilities to handle complex numbers -- that
would be pretty far from its mission to be a relatively simple and
However, it shouldn't be too hard to set up some rudimentary routines
that would take the real and imaginary parts as a two element array
value, do the math, and return a two element array variable with a real
and imaginary part.
I'm not aware of anyone who's already done this, but if you can find
corresponding algorithms on the 'net, you should be able to translate
them to LB.
Might search the LB conforums at:
I came up with one promising post that sounds like what I proposed:
On 3/30/2013 2:49 PM, phil wrote:
> please - has anyone found a way to use complex numbers in liberty basic ?
> thanks - phil geffe
- --- In email@example.com, Fred Jensen <k6dgw@...> wrote:
>You may also check out http://justbasic.conforums.com/index.cgi?board=tips&action=display&num=1364468949
> On 3/30/2013 11:49 AM, phil wrote:
> > please - has anyone found a way to use complewx numbers in liberty basic ?
> > thanks - phil geffe
> I've never see a BASIC that had complex arithmetic built in. Then of
> course, I have seen only a handful of BASIC's, Liberty being the last.
> In all the other cases, I had to write functions and subroutines to do
> the arithmetic ...
- You might like to look at
http://diga.me.uk/index.html - scroll to the 'Complexity' link.
If you search the JB & LB boards there's quite a lot of stuff from me,
tsh73, bluatigro et al on representing complex numbers in LB.
'tenochtitlanuk' - JohnF