automatically assigning names to indexes

George Sakkis gsakkis at rutgers.edu
Tue Jul 12 14:53:13 EDT 2005


<simonwittber at gmail.com> wrote

> > And what should happen for vectors of size != 3 ? I don't think that a
> > general purpose vector class should allow it; a Vector3D subclass would
> > be more natural for this.
>
> That's the 'magic' good idea I'm looking for. I think a unified Vector
> class for all size vectors is a worthy goal!

What 'magic' ? The (x,y,z) notation is used only for 3D vectors. (x,y)
is also common for 2D and perhaps (t,x,y,z) for 4D, with t for time.
There are only 26 letters (or 52 if you allow capitals), so I don't see
how this can be generalized _usefully_ to arbitrary number of
dimensions.

George




More information about the Python-list mailing list