Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Oh why is life never easy? Need help with |vector|

  • Subject: [mg2771] Oh why is life never easy? Need help with |vector|
  • From: ULI12 at (ULI WORTMANN)
  • Date: Sat, 16 Dec 1995 19:08:35 -0500
  • Approved:
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: Dept. of Geology, Tech. Univ. Munich

Hi All,

I need to calculate v0 = v / |v| where v is a vector of size 3.
However, |v|, which is a scalar, is for some reason (I don't
understand) treated like a vector (at least VectorQ[|v|] gives
TRUE). Obviously, it is impossible to divide two vectors of different

 |v| is defined as:
	absvec[u_] :=
		{a = Sqrt[(u[[1]]^2+u[[2]]^2+u[[3]]^2)]}]

and called as u = 1/absvec[v]

To bad I have no idea what's wrong with this code. Any input is

	Uli Wortmann

	Dept. of Geology       Fax (Germany) 89 3209 3168
	Tech. Univ. Munich     Fon		     3232
	email: uli at

  • Prev by Date: RE: Re: Re: X-FrontEnd crashes upon certain keystrokes
  • Next by Date: Re: How to get labels correctly plotted
  • Previous by thread: Re: Question on NDSolve (Mathematica)
  • Next by thread: Oh why is life never easy? Need help with |vector|