File: revolipsoid.mp

package info (click to toggle)
texlive-base 2020.20210202-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 791,092 kB
  • sloc: perl: 45,038; sh: 4,926; makefile: 4,655; ansic: 2,266; ruby: 2,231; tcl: 2,156; xml: 1,874; python: 822; cpp: 695; awk: 606; lisp: 199; sed: 8
file content (50 lines) | stat: -rw-r--r-- 897 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% revolipsoid.mp
% L. Nobre G.
% 2011

input featpost3Dplus2D;

prologues := 1;

Spread := 20;
f := 7.1*(3,5,4);
ShadowOn := true;
HoriZon := -5;
LightSource := 10*(4,-2,4);

beginfig(1);
  setthestage(30,45);
  drawoptions( withpen pencircle scaled 1mm );
  numeric num, r, ste, i, j, aux;
  r = 1.6;
  num = 5;
  aux = 0.5*(num-1);
  ste = 90/aux;
  for i=-aux upto aux:
    for j=-aux upto aux:
      spheroid((red*j+green*i)*2*(r**aux),(cosd(i*ste),0,sind(i*ste)),r**(-j));
    endfor;
  endfor;
endfig;

ShadowOn := false;

beginfig(2);
  drawoptions( withpen pencircle scaled 1mm );
  numeric num, r, ste, i, j, aux, fac;
  color aim;
  r = 0.55;
  fac = 0.6;
  num = 6;
  aux = 0.5*(num-1);
  ste = 90/aux;
  for i=-aux upto aux:
    for j=-aux upto aux:
      aim := N(f-viewcentr)+fac*(i*red+j*green)/aux;
      spheroid((red*j+green*i)*3*r,aim,r);
    endfor;
  endfor;
endfig;

end.