summaryrefslogtreecommitdiff
path: root/graphics/epix/samples/slopefield.xp
blob: 5ecfd597c1f1b4a91e70a2575ecbb004ac377513 (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;

P F(double s, double t)
{
  return P(0.1*s, 0.025*t) + (1/(0.01+s*s+t*t))*P(-t, s);
}

int main()
{
  picture(P(-4, -3), P(2,2), "3x2.5in");

  begin();

  blue(1.8);
  dart_field(F, P(xmin(), ymin()), P(xmax(), ymax()), 4*xsize(), 4*ysize());
  set_crop();

  bold();
  for (int i=0; i<7; ++i)
    {
      rgb(0.05*(7-i), 1 - 0.1*i, 0.15*i);
      ode_plot(F, P(-0.9-0.025*i,0), 20, 200);
    }

  end();
}