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