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

Function main

examples/line_plot/plot3/plot3_4.cpp:5–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <thread>
4
5int main() {
6 using namespace matplot;
7 auto t = iota(0, pi / 500, 40 * pi);
8 auto xt =
9 transform(t, [](auto t) { return (3. + cos(sqrt(32.) * t)) * cos(t); });
10 auto yt = transform(t, [](auto t) { return sin(sqrt(32.) * t); });
11 auto zt =
12 transform(t, [](auto t) { return (3. + cos(sqrt(32.) * t)) * sin(t); });
13 plot3(xt, yt, zt);
14 axis(equal);
15 xlabel("x(t)");
16 ylabel("y(t)");
17 zlabel("z(t)");
18
19 auto ax = gca();
20 float da = ax->azimuth();
21 for (size_t i = 0; i <= 360; ++i) {
22 ax->azimuth(da + 2 * i);
23 std::this_thread::sleep_for(std::chrono::milliseconds(50));
24 }
25
26 show();
27 return 0;
28}

Callers

nothing calls this directly

Calls 10

iotaFunction · 0.85
transformFunction · 0.85
axisFunction · 0.85
xlabelFunction · 0.85
ylabelFunction · 0.85
zlabelFunction · 0.85
gcaFunction · 0.85
showFunction · 0.85
azimuthMethod · 0.80
plot3Function · 0.50

Tested by

no test coverage detected