Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
The definition of the Complex type seems a little weak. A few things: To get the Cartesian components of the value there are two methods (re and im). In contrast there is just one method polar to return the polar components of the value I'm not sure that this asymmetry is a good thing.

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Jon Lang
On Wed, Dec 16, 2009 at 2:10 PM, Dave Whipp d...@dave.whipp.name wrote: The definition of the Complex type seems a little weak. A few things: To get the Cartesian components of the value there are two methods (re and im). In contrast there is just one method polar to return the polar

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Moritz Lenz
Dave Whipp wrote: The definition of the Complex type seems a little weak. A few things: To get the Cartesian components of the value there are two methods (re and im). In contrast there is just one method polar to return the polar components of the value Not quite, .abs returns one of the

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Doug McNutt
At 00:15 +0100 12/17/09, Moritz Lenz wrote: Not quite, .abs returns one of the polar coordinates (the magnitude), so only a method is missing that returns the angle. Any ideas for a good name? In pre-computer times the angle was called the argument. But that offers plenty of room for confusion

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread yary
At 00:15 +0100 12/17/09, Moritz Lenz wrote: Not quite, .abs returns one of the polar coordinates (the magnitude), so only a method is missing that returns the angle. Any ideas for a good name? Would a method called phi with a unicode synonym φ be too obtuse? -y

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
Moritz Lenz wrote: our multi method polar (Complex $nim: -- [ Real $mag where 0..Inf, Real $angle where -π ..^ π ]) is export { ... } If you put this into a signature, it is checked on every call to that method and thus slows down execution. If you want a formalization that's not part of

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
yary wrote: At 00:15 +0100 12/17/09, Moritz Lenz wrote: Not quite, .abs returns one of the polar coordinates (the magnitude), so only a method is missing that returns the angle. Any ideas for a good name? Would a method called phi with a unicode synonym φ be too obtuse? Anything wrong

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Brandon S. Allbery KF8NH
On Dec 16, 2009, at 19:46 , Dave Whipp wrote: yary wrote: At 00:15 +0100 12/17/09, Moritz Lenz wrote: Not quite, .abs returns one of the polar coordinates (the magnitude), so only a method is missing that returns the angle. Any ideas for a good name? Would a method called phi with a unicode