From: Bruce S. <bas...@un...> - 2002-07-08 02:19:19
|
Thanks to Arthur Siegel for suggesting making the mag2 function available. This function for vectors gives the square of the magnitude of a vector: v = vector(1,2,3) # a vector whose magnitude is 14 mag(v) or v.mag is sqrt(14) mag2(v) or v.mag2 is 14 Not previously documented for mag, and now also available for mag2, is the possibility of setting the associated attribute for a vector: v.mag = 5 # make the magnitude of v be 5 v.mag2 = 2.7 # make the square of the magnitude of v by 2.7 At http://vpython.org there are new files associated with mag2: documentation, the visual folder, source, Windows DLL, and a full Windows installer. Haven't yet updated installers for Linux or Macintosh. Bruce Sherwood |