summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/parafusoprojxy.mp
blob: e43c296667436ed7b75858dc70a3e2de0563b7d3 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
% parafusoprojxy.mp
% L. Nobre G.
% 2009

input featpost3Dplus2D;

def theline( expr TheVal ) = 
  begingroup
    numeric par[], cred, cgre, cblu, param;
    par0 = 0;
    par1 = 6*360;
    par2 = 0.3;
    par3 = 850;
    param = par0+TheVal*(par1-par0);
    cred = -par2*cosd( param );
    cblu = par2*sind( param );
    cgre = param/par3;
    ( (cred,cgre,cblu) )
  endgroup 
enddef;

def thexyline( expr TheVal ) = 
  begingroup
    numeric par[], cred, cgre, param;
    par0 = 0;
    par1 = 6*360;
    par2 = 0.3;
    par3 = 850;
    param = par0+TheVal*(par1-par0);
    cred = -par2*cosd( param );
    cgre = param/par3;
    ( (cred,cgre,0) )
  endgroup 
enddef;

f := (3,5,15);
beginfig(1); 
  numeric axsize, zaxpos, zaxlen;
  color xbeg, xend, ybeg, yend, zbeg, zend;
  axsize = 0.85;
  zaxpos = 0.55;
  zaxlen = 2.1;
  pickup pencircle scaled 1.5pt;
  xbeg = (axsize,0,0);
  xend = (-axsize,0,0);
  ybeg = (0,0,-axsize);
  yend = (0,0,axsize);
  zbeg = (zaxpos,-zaxpos,0);
  zend = (zaxpos,zaxlen,0);
  drawarrow rp( xbeg )--rp( xend );
  drawarrow rp( ybeg )--rp( yend );
%	defaultfont := "putr8r";
  defaultscale := 0.65;
  label.rt( "X", rp( xend ) );
  label.lft( "Y", rp( yend ) );
  emptyline( false, 1, black, 0.7background, 700, 0.8, 2, thexyline );
  drawarrow rp( zbeg )--rp( zend );
  label.bot( "Z", rp( zend ) );
endfig;

end;