File: plotting2.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-- 466 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 r, double th)
{
  return P(r*Cos(th), r*Sin(th), pow(r, 3)*Cos(3*th));
}

int main()
{
  picture(P(-1,-1),P(1,1), "2x1in");

  begin();

  domain R(P(0,0), P(1, 2*M_PI), mesh(8,40), mesh(16,120));

  camera.at(3,1,2); // set the viewpoint

  arrow(P(0,0,0), P(1.25,0,0));
  arrow(P(0,0,0), P(0,1.25,0));

  plain(Blue(1.2));
  fill(Yellow()); // shade
  surface(f, R);

  pst_format();
  end();
}