From: Bruce S. <bas...@un...> - 2002-07-08 14:47:49
|
Yes, Will. Exactly. Change the magnitude (or magnitude squared) but keep the direction. so setting v.mag = 1 is the same as setting v = norm(v). Bruce Sherwood At 10:32 AM 02/07/08 -0400, William A. Chase wrote: >Professor Sherwood, > I have a quick question about the mag/mag2 functionality that you >explained where you can explicitly set the variable mag equal to a value. >Does the syntax "v.mag = X" maintain the direction of the vector v, but >setting it's magnitude to X? Say we perform the code: > >v = vector(5,10,15) #arbitrary direction & magnitutude >v.mag = 1 > >Would this make the vector v into a unit vector in the same direction? >Just curious... Thanks a bundle! > >-- Will Chase >Sophomore Astro Major >CMU |