fix typo in size of mean vector for Point2Pair means()
parent
1dd20a39fc
commit
2252d5ee0d
|
|
@ -116,7 +116,7 @@ list<Point2> circleCircleIntersection(Point2 c1, double r1, Point2 c2,
|
||||||
Point2Pair means(const std::vector<Point2Pair> &abPointPairs) {
|
Point2Pair means(const std::vector<Point2Pair> &abPointPairs) {
|
||||||
const size_t n = abPointPairs.size();
|
const size_t n = abPointPairs.size();
|
||||||
if (n == 0) throw std::invalid_argument("Point2::mean input Point2Pair vector is empty");
|
if (n == 0) throw std::invalid_argument("Point2::mean input Point2Pair vector is empty");
|
||||||
Point2 aSum(0, 0, 0), bSum(0, 0, 0);
|
Point2 aSum(0, 0), bSum(0, 0);
|
||||||
for (const Point2Pair &abPair : abPointPairs) {
|
for (const Point2Pair &abPair : abPointPairs) {
|
||||||
aSum += abPair.first;
|
aSum += abPair.first;
|
||||||
bSum += abPair.second;
|
bSum += abPair.second;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue