PDA

View Full Version : Norm of a vector


Chrissy2009
05-12-2009, 01:21 AM
Hi,
how can I calculate the norm of a vector or how can I extract a root in pyhton?

Sorry, but I can't find any information about this.. :(

Thanks a lot.

farshizzo
05-12-2009, 09:03 AM
You can use the viz.Vector class to get the length of any vector. Here is some code:v = viz.Vector(0,3,0)
print v.length()
v.normalize()
print v.length()