title: c++ normalize a vector to a double?
body: <p>I am trying to follow an algebraic equation, and convert it to c++.</p>
  
  <p>I am stuck on:</p>
  
  <pre><code>Calculate the radius as r = ||dp||
  </code></pre>
  
  <p>where dp is a vector, and:</p>
  
  <pre><code> dp = (dx,dy)
  </code></pre>
  
  <p>According to my google searching, the vertical bars in r = ||dp|| mean I need to normalize the vector. </p>
  
  <p>I have:</p>
  
  <pre><code>std::vector&lt;double&gt; dpVector;
  dpVector.push_back(dx);
  dpVector.push_back(dy);
  </code></pre>
  
  <p>How should I be normalizing this so that it returns a double as 'r'?</p>