mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 01:51:49 +08:00
M_PI not easily defined for every compiler
This commit is contained in:
parent
1a9593409a
commit
57ce23426d
@ -7,6 +7,7 @@
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
#include "jkqtplotter/graphs/jkqtpfilledcurve.h"
|
||||
#include "jkqtcommon/jkqtpmathtools.h"
|
||||
#include <random>
|
||||
|
||||
void drawRandomWalkX(JKQTPlotter& plot) {
|
||||
@ -94,7 +95,7 @@ void drawWavepacketsY(JKQTPlotter& plot) {
|
||||
const double offset=(static_cast<double>(nw)*1.5+1.5);
|
||||
for (size_t ti=0; ti<NSteps; ti++) {
|
||||
const double t=ds->get(columnT, ti);
|
||||
ds->set(columnPacket, ti, offset+sin(2.0*M_PI*t/wavelength)*exp(-0.5*jkqtp_sqr(t-pos)/jkqtp_sqr(packwidth)));
|
||||
ds->set(columnPacket, ti, offset+sin(2.0*JKQTPSTATISTICS_PI*t/wavelength)*exp(-0.5*jkqtp_sqr(t-pos)/jkqtp_sqr(packwidth)));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user