beginner oo programming

Multiscan gcangiani at yahoo.it
Mon Mar 3 02:19:52 EST 2003


On Tue, 25 Feb 2003 10:47:57 +0000, Steven Taschuk wrote:
> 
> If you use Cartesian coordinates internally, the Cartesian
> coordinate system object can access them directly.  Other
> coordinate system objects ask for the Cartesian representation and
> convert.  (This assumes that
> 	v.components(polar)
> delegates to, say,
> 	polar.components(v)
> And the reverse: vector(tuple, coordsystem) delegates to
> coordsystem.makevector(tuple) or some such.  The nice thing about
> this scheme is that the knowledge of how to convert to/from a
> given coordinate system is stored in the object which represents
> that coordinate system.  Good abstraction.)
> 
> (Note, incidentally, that oblique (and rotated) coordinate systems
> can be implemented with a matrix and a bit of linear algebra.)
> 
> How does that sound?

I couldn't imagine a better answer. 
Thanks very mutch !

	giovanni





More information about the Python-list mailing list