File: slopefield.xp

package info (click to toggle)
epix 1.2.22-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,256 kB
  • sloc: cpp: 16,847; sh: 5,054; makefile: 159; lisp: 6
file content (29 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (9)
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();
}