forked from mrexodia/matplotplusplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3_3.cpp
More file actions
21 lines (18 loc) 路 712 Bytes
/
Copy pathplot3_3.cpp
File metadata and controls
21 lines (18 loc) 路 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <cmath>
#include <matplot/matplot.h>
int main() {
using namespace matplot;
std::vector<double> t = iota(0, pi/500, pi);
std::vector<std::vector<double>> X(3);
std::vector<std::vector<double>> Y(3);
X[0] = transform(t,[](auto x){return sin(x)*cos(10*x);});
X[1] = transform(t,[](auto x){return sin(x)*cos(12*x);});
X[2] = transform(t,[](auto x){return sin(x)*cos(20*x);});
Y[0] = transform(t,[](auto x){return sin(x)*sin(10*x);});
Y[1] = transform(t,[](auto x){return sin(x)*sin(12*x);});
Y[2] = transform(t,[](auto x){return sin(x)*sin(20*x);});
std::vector<double> z = transform(t,[](auto x){return cos(x);});
plot3(X,Y,z);
wait();
return 0;
}