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

Function main

examples/line_plot/plot3/plot3_2.cpp:4–20  ·  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<double> xt1 =
8 transform(t, [](auto x) { return sin(x) * cos(10 * x); });
9 std::vector<double> yt1 =
10 transform(t, [](auto x) { return sin(x) * sin(10 * x); });
11 std::vector<double> zt1 = transform(t, [](auto x) { return cos(x); });
12 std::vector<double> xt2 =
13 transform(t, [](auto x) { return sin(x) * cos(12 * x); });
14 std::vector<double> yt2 =
15 transform(t, [](auto x) { return sin(x) * sin(12 * x); });
16 std::vector<double> zt2 = transform(t, [](auto x) { return cos(x); });
17 plot3(xt1, yt1, zt1, xt2, yt2, zt2);
18 show();
19 return 0;
20}

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