Vectors

Algis Kabaila akabaila at pcug.org.au
Thu Apr 21 03:25:01 EDT 2011


On Thursday 21 April 2011 01:49:57 Andreas Tawn wrote:
> > On Apr 20, 6:43 am, Andreas Tawn <andreas.t... at ubisoft.com> 
wrote:
> > > > Algis Kabaila <akaba... at pcug.org.au> writes:
> > > > > Are there any modules for vector algebra (three
> > > > > dimensional vectors, vector addition, subtraction,
> > > > > multiplication [scalar and vector]. Could you give
> > > > > me a reference to such module?
> > > > 
> > > > NumPy has array (and matrix) types with support for
> > > > these basic operations you mention. See the tutorial
> > > > athttp://numpy.scipy.org/
> > > 
> > > You might also want to
> > > considerhttp://code.google.com/p/pyeuclid/
> > > 
> > > Cheers,
> > > 
> > > Drea
> > 
> > Pyeuclid docs don't mention dot or cross products.
> > RJB
> 
> http://partiallydisassembled.net/euclid/vector-classes.html#S
> ECTION002220000000000000000
> 
> Bottom of the page.
> 
> Cheers,
> 
> Drea

Yes, pyeuclid had "cross" and "dot" product of vectors. I am 
impressed with it and curious how it works:  the Vector3 class 
is available without any prefix euclid:

import euclid 
v = Vector3(111.., 222.2, 333.3)

works without  requiring as in:
v = euclid.Vector3( etc...)

I am really intrigued by that. OTOH, I also am somewhat 
aprehensive about using something that affects the program 
writing after importing "euclid", without any need to explicitly 
refer to euclid.  Looks rather risky to me.  What does that do 
to the namespace?

Thanks for bringing this to my attention.  I confess that I 
would be hapier if euclid was accessible in a "standard" manner 
with prefix of module name for classes in the module.

OldAl.

-- 
Algis
http://akabaila.pcug.org.au/StructuralAnalysis.pdf



More information about the Python-list mailing list