aboutsummaryrefslogtreecommitdiff
path: root/src/input/mult3d.input.pamphlet
blob: 4920aaf92700457b81c27fd29adae8c56e5e6df5 (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
65
66
67
68
69
70
71
72
73
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input mult3d.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>

)clear all
s := create3Space()$ThreeSpace(DFLOAT)
draw(curve(sin(t),cos(t),0),t=0..2*%pi,tubeRadius==.3, space == s)
draw(curve(sin(t)*cos(%pi/2),cos(t),0-sin(t)*sin(%pi/2)),t=0..2*%pi,tubeRadius==.3, space == s)

v1 := draw(curve(sin(t),cos(t),0),t=0..2*%pi,tubeRadius==.3)
s1 := subspace(v1)
v2 := draw(curve(sin(t)*cos(%pi/2),cos(t),0-sin(t)*sin(%pi/2)),t=0..2*%pi,tubeRadius==.3, space == s1)
s2 := subspace(v2)

)clear all
v := draw(surface(x*cos(y),x*sin(y),y*cos(x)),x=-4..4,y=0..2*%pi)
s := subspace(v)
makeObject(curve(4*sin(t),4*cos(t),-4),t=0..2*%pi,tubeRadius==.3, space == s)
makeObject(curve(4*sin(t),4*cos(t),0),t=0..2*%pi,tubeRadius==.3, space == s)
draw(curve(4*sin(t),4*cos(t),4),t=0..2*%pi,tubeRadius==.3, space == s)

)clear all
s := makeObject(surface(cos(t)*sin(p),sin(t)*sin(p),cos(p)),t=0..2*%pi,p=0..%pi)
makeObject(curve(4*sin(t)*cos(%pi/2),4*cos(t),0-sin(t)*sin(%pi/2)),t=0..2*%pi,tubeRadius==.3, space == s)
draw(curve(2*sin(t),2*cos(t),0),t=0..2*%pi,tubeRadius==.3, space == s)

)clear all
s := makeObject(curve(4*sin(t),4*cos(t),0),t=0..2*%pi,tubeRadius==.3)
makeObject(surface(cos(t)*sin(p),sin(t)*sin(p),cos(p)),t=0..2*%pi,p=0..%pi, space == s)
makeObject(surface(cos(t)*sin(p)-3,sin(t)*sin(p)-3,cos(p)+2),t=0..2*%pi,p=0..%pi, space == s)
draw(surface(cos(t)*sin(p)-6,sin(t)*sin(p)-6,cos(p)+4),t=0..2*%pi,p=0..%pi, space == s)

)clear all
s := create3Space()$ThreeSpace(DFLOAT)
draw(cos(x*y)+1,x=-3..3,y=-3..3, space == s)
draw(-cos(x*y)-1,x=-3..3,y=-3..3, space == s)

)clear all
torusInKnot(p,q,r) ==
  free sp
  sp := create3Space()$ThreeSpace(DFLOAT)
  a := 1
  b := 1
  ab := a+b
  fac := 2*ab/(1.1*ab-sin(q*t))
  Title := concat("Torus Knot of Type (", concat(p::String, 
                  concat(",", concat(q::String, ")"))))
  Curve := curve(a*fac*cos(p*t), a*fac*sin(p*t), b*fac*cos(q*t))
  r = 0 => draw(Curve, t=0..2*%pi, title == Title)
  draw(Curve, t=0..2*%pi, tubeRadius == r, title == Title, space == sp)

torusInKnot(15,17,.1)
draw(curve(2.2*sin(t),2.2*cos(t),0),t=0..2*%pi,tubePoints==10,tubeRadius==.7, space == sp)
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}