#include "Ring.h" #include #include #include "Led.h" using namespace std; Ring::Ring(double x, double y) : fX(x), fY(y), fR(0), fPhi(0) { } bool Ring::CalcCenter(Led i, Led j, Led k) { double h1 = i.GetY() - j.GetY(); if (h1==0) { std::swap(j, k); h1 = i.GetY() - j.GetY(); if (h1==0) { cout << "Ring::CalcCenter: h1==0" < &rings) { fX = 0; fY = 0; fR = 0; fMag=0; const int n=rings.size(); if (n==0) return; for (auto it=rings.begin(); it!=rings.end(); it++) { fX += it->GetX(); fY += it->GetY(); fR += it->GetR(); fMag += it->GetMag(); } fX /= n; fY /= n; fR /= n; fMag /= n; }