daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template<size_t dim>
  2. double pathLength2(points<dim> ps){
  3.     if(ps.size() < 2){
  4.         return 0;
  5.     }
  6.     point<dim> prev = ps[ps.size()-1];
  7.     return accumulate(ps.begin(), ps.end(), 0.0, [&prev](double acc, point<dim> &p)->double{
  8.             double ret = acc + dist(prev, p);
  9.             prev = p;
  10.             return ret;
  11.             });
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top