summaryrefslogtreecommitdiff
path: root/graphics/epix/samples/polar.xp
blob: d2c19345527b2de69af624282a86947e53be4311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
}