Skip to content
Snippets Groups Projects
Commit 71ab8a47 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: add normalise methods for vectors and normalised function

- the vector normalise() method modifies the object inplace,
  the normalised function returns a copy.

      vector vec1(1,2,3);
      vec1.normalise();
  vs
      vector vec1(1,2,3);
      vec1 /= mag(vec1) + VSMALL;

  For const usage, can use either of these

      const vector vec2a(normalised(vector(1,2,3)));
      const vector vec2b(vector(1,2,3).normalise());
parent 03049119
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment