| 3 | #include <thread> |
| 4 | |
| 5 | int main() { |
| 6 | using namespace matplot; |
| 7 | |
| 8 | auto xt = [](double t) { |
| 9 | return exp(-std::abs(t) / 10) * sin(5 * std::abs(t)); |
| 10 | }; |
| 11 | auto yt = [](double t) { |
| 12 | return exp(-std::abs(t) / 10) * cos(5 * std::abs(t)); |
| 13 | }; |
| 14 | auto zt = [](double t) { return t; }; |
| 15 | auto fp = fplot3(xt, yt, zt)->t_range({-10, 10}).color("r"); |
| 16 | xlabel("e^{-|z|/10} sin(2|z|)"); |
| 17 | ylabel("e^{-|z|/10} cos(2|z|)"); |
| 18 | zlabel("z"); |
| 19 | grid(true); |
| 20 | |
| 21 | auto ax = gca(); |
| 22 | float da = ax->azimuth(); |
| 23 | float de = ax->elevation(); |
| 24 | for (size_t i = 0; i <= 180; ++i) { |
| 25 | view(da + 2 * i, de + i); |
| 26 | title("Azimuth: " + num2str(da + 2 * i) + |
| 27 | " Elevation: " + num2str(de + i)); |
| 28 | std::this_thread::sleep_for(std::chrono::milliseconds(50)); |
| 29 | } |
| 30 | |
| 31 | show(); |
| 32 | return 0; |
| 33 | } |
nothing calls this directly
no test coverage detected