diff options
Diffstat (limited to 'graphics/epix/samples/polar.xp')
-rw-r--r-- | graphics/epix/samples/polar.xp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/graphics/epix/samples/polar.xp b/graphics/epix/samples/polar.xp new file mode 100644 index 0000000000..d2c1934552 --- /dev/null +++ b/graphics/epix/samples/polar.xp @@ -0,0 +1,29 @@ +/* -*-ePiX-*- */ +#include "epix.h" +using namespace ePiX; + +double f(double t) +{ + return 2*Cos(3*t); +} + +int main() +{ + picture(P(-2,-2), P(2,2), "2x2in"); + + begin(); + degrees(); + + black(0.3); + polar_grid(2, 4, 24); // radius, rings, sectors + + black(); + bottom_axis(4, P(0,-4)).subdivide(2).draw(); + left_axis(4, P(-4,0)).subdivide(2).draw(); + + bold(); + polarplot(f, 0, 180, 120); // plot over [0, 180] using 120 intervals + + end(); +} + |