| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | |
| 7 | double r = 2; |
| 8 | double xc = 4; |
| 9 | double yc = 3; |
| 10 | std::vector<double> theta = linspace(0, 2 * pi); |
| 11 | std::vector<double> x = |
| 12 | transform(theta, [=](auto theta) { return r * cos(theta) + xc; }); |
| 13 | std::vector<double> y = |
| 14 | transform(theta, [=](auto theta) { return r * sin(theta) + yc; }); |
| 15 | plot(x, y); |
| 16 | axis(equal); |
| 17 | |
| 18 | show(); |
| 19 | return 0; |
| 20 | } |