[EMAIL PROTECTED] writes:

> I was thinking of using complex numbers as the machine representation
> for Cartesian coordinates mostly based on the (perhaps misguided)
> assumption that I could use phase and cis for nothing.

These operators are not implemented in hardware, of course, and I don't
know if they've been optimized much in cmucl. I do see the value of
doing it this way: the implementation can optimize it once for everyone
and you can piggyback off that effort.

However, since those operations are trig ones, I doubt they'll be
optimized for integer or fixnum inputs in any implementation. I would
use a floating-point complex type.

I would still use abstracted constructor and accessor functions for this
in case, for example, you determine that storing in polar form is more
efficient, taking the hit when you need rectangular coordinates instead.

-- 
Rahul Jain
[EMAIL PROTECTED]
Professional Software Developer, Amateur Quantum Mechanicist


Reply via email to