int x,y // the position of the tracked object; vector<Point>cont(0); Point a; a = Point(x,y); cont.push_back(a); int p,q,r; for(int i= 0; i <cont.size(); i++) { p = pow((cont.at(i+1).x - cont.at(i).x),2)); q = pow((cont.at(i+1).y - cont.at(i).y),2)); r = sqrt(p+q); cout<<"The distance is:"<<r<<endl; }
i < ( cont.size() - 1 )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)