Normalizing means making the length of a vector == 1. In your code, the length is given by "pythag". And it's already one (nearly). So normalizing it does nothing.
You say "all values need to be less than 1"... which is correct. But your z value is fine. 9.01522444274e-07 < 1. (It's really close to zero, in fact.) Why do you say you can't use it "as unit vector"? It is PART of a unit vector... I think you probably need to review your basic vector math... On Thu, Oct 9, 2014 at 7:18 AM, <[email protected]> wrote: > ummm, well let me show you what im trying to do. i need to normalise a > vector > > so ive got > > x= 0.952419936657 > y= 0.304788768291 > z= 9.01522412278e-07 > > so i do pythag > > pythag=math.sqrt((x*x)+(y*y)+(z*z)) > pythag=0.999999964509 > > x=0.952419936657/pythag > y=0.304788768291/pythag > z=9.01522412278e-07/pythag > > so after this, all values need to be less than 1 right? > > but z is like this: 9.01522444274e-07 .which i cant use as unit vector. i > think it needs converting to decimal or something? > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/73567498-a0d2-49e3-90b0-ddd5a94bc1bb%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAssL7auaZDCBe98jNn91T3dwgXLUW4Q%2BVSJqjD-GQa994Co2g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
