MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / main

Function main

examples/line_plot/plot3/plot3_3.cpp:4–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <matplot/matplot.h>
3
4int main() {
5 using namespace matplot;
6 std::vector<double> t = iota(0, pi / 500, pi);
7 std::vector<std::vector<double>> X(3);
8 std::vector<std::vector<double>> Y(3);
9
10 X[0] = transform(t, [](auto x) { return sin(x) * cos(10 * x); });
11 X[1] = transform(t, [](auto x) { return sin(x) * cos(12 * x); });
12 X[2] = transform(t, [](auto x) { return sin(x) * cos(20 * x); });
13 Y[0] = transform(t, [](auto x) { return sin(x) * sin(10 * x); });
14 Y[1] = transform(t, [](auto x) { return sin(x) * sin(12 * x); });
15 Y[2] = transform(t, [](auto x) { return sin(x) * sin(20 * x); });
16 std::vector<double> z = transform(t, [](auto x) { return cos(x); });
17 plot3(X, Y, z);
18
19 show();
20 return 0;
21}

Callers

nothing calls this directly

Calls 4

iotaFunction · 0.85
transformFunction · 0.85
showFunction · 0.85
plot3Function · 0.50

Tested by

no test coverage detected