Group Abstract Group Abstract

Message Boards Message Boards

0
|
557 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Norm[] of real vector

Posted 22 days ago

Is there a trick to using Norm[] on real vectors that avoids results like Abs[x]^2 and that is more straightforward than Sqrt[Total[vector^2]]?

POSTED BY: Jay Gourley
3 Replies

I wish there was a RealNorm, analogue of RealAbs. I sometimes use

realNorm[x_] := Norm[x] /. Abs -> Identity

which may fail if the vector itself already contains Abs.

POSTED BY: Gianluca Gorni

No, not really. ComplexExpand@Norm[{x, y}] does not seem more straightforward.

I often use norm = Sqrt[# . #]&, fwiw.

POSTED BY: Michael Rogers
Posted 22 days ago

Thanks, Michael Rogers. Just reading your post triggered a solution. The function "norm[list]" would be perfectly clear to anyone who saw it and could do exactly what I want. My failure to see that is typical. I occasionally spend more time pouring over Wolfram documentation than would take to write a function and give a name that means exactly what I want it to say.

POSTED BY: Jay Gourley
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard