1

I'm not sure how to say unitfy for a vecor.

What I say is, for vector (4,3) -> (4/5,3/5). Just to divide the vector by its length.

I can to this as vv = v / np.linalg.norm(v)

What is the right word for unitfy and the standard way of doing it?

ZK Zhao
  • 19,885
  • 47
  • 132
  • 206

1 Answers1

2

The word is "normalize": http://mathworld.wolfram.com/NormalizedVector.html

Dividing by the norm is a pretty standard way of doing this. Watch for the case when the norm is very close to zero (may want to compate it with epsilon and handle that case specially, or throw an exception).

See also: how to normalize array numpy?

Community
  • 1
  • 1
Alex I
  • 19,689
  • 9
  • 86
  • 158