init
All checks were successful
CMake on a single platform / build (push) Successful in 22s

This commit is contained in:
2024-09-12 23:40:20 +04:00
committed by Andrey Alekseev
parent 73aec484df
commit 8fbbf0afcf
4 changed files with 126 additions and 25 deletions

View File

@@ -53,32 +53,18 @@ public:
data_.clear();
data_.reserve(rowCount());
vector<double> vals;
vals.reserve( discreteModel->rowCount());
double first_positive = DBL_MAX;
for(int i = 0; i < discreteModel->rowCount(); i++) {
auto v = discreteModel->data(i, 1);
vals.push_back(v);
if ( abs(vals[i]) > 0 && abs(vals[i]) < first_positive )
first_positive = abs(vals[i]);
}
for ( int k = 0; k < rowCount(); k++ ) {
if ( first_positive > 0 ) {
double x = 0,
y = 0;
for ( int n = 0; n < discreteModel->rowCount(); n++ ) {
double e = 2*M_PI*k*n/discreteModel->rowCount();
double x = vals[n] / first_positive;
double x = 0,
y = 0;
for ( int n = 0; n < discreteModel->rowCount(); n++ ) {
double e = 2*M_PI*k*n/discreteModel->rowCount();
double v = discreteModel->data(n, 1);;
x+=x*cos(e);
y-=x*sin(e);
}
x+=v*cos(e);
y-=v*sin(e);
}
data_[k] = {sqrt(x*x+y*y), atan2(y,x)};
} else data_[k] = {0,0};
data_[k] = {sqrt(x*x+y*y)/rowCount(), atan2(y,x)};
}
changed().emit();
@@ -86,7 +72,6 @@ public:
}
virtual double data(int row, int column) const override {
//double x = row/(2*M_PI);
switch ( column ) {
case 0: return row;
case 1: return data_[row].first;

View File

@@ -6,7 +6,7 @@ using namespace std;
using namespace Wt;
int main(int argc, char *argv[]) {
int main(int argc, char* argv[]) {
int code = 0;
try {