aboutsummaryrefslogtreecommitdiff
path: root/src/input/bouquet.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/bouquet.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/bouquet.input.pamphlet')
-rw-r--r--src/input/bouquet.input.pamphlet60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/input/bouquet.input.pamphlet b/src/input/bouquet.input.pamphlet
new file mode 100644
index 00000000..28d9b215
--- /dev/null
+++ b/src/input/bouquet.input.pamphlet
@@ -0,0 +1,60 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input bouquet.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1994.
+@
+<<*>>=
+<<license>>
+-- relative size of the arrow head compared to the length of the arrow
+arrowScale := 0.2@DFLOAT
+
+-- angle of the arrow head
+arrowAngle := %pi-%pi/10.0@DFLOAT
+
+-- Add an arrow head to a line segment, which starts at 'p1', ends at 'p2',
+-- has length 'len', and and angle 'arg'. We pass 'len' and 'arg' as
+-- arguments since they were already computed by the calling program
+makeArrow(p1, p2) ==
+ delta := p2 - p1
+ len := arrowScale * length delta
+ theta := atan(delta.1, delta.2)
+ c1 := len * cos(theta + arrowAngle)
+ s1 := len * sin(theta + arrowAngle)
+ c2 := len * cos(theta - arrowAngle)
+ s2 := len * sin(theta - arrowAngle)
+ z := p2.3*(1 - arrowScale)
+ p3 := point [p2.1 + c1, p2.2 + s1, z, p2.4]
+ p4 := point [p2.1 + c2, p2.2 + s2, z, p2.4]
+ [[p1, p2, p3], [p2, p4]]
+
+drawBouquet(n,title) ==
+ angle := 0.0@DFLOAT
+ sp := create3Space()$ThreeSpace(DFLOAT)
+ for i in 0..n-1 repeat
+ start := point [0.0@DFLOAT,0.0@DFLOAT,0.0@DFLOAT,angle]
+ end := point [cos angle, sin angle, 1.0@DFLOAT, angle]
+ arrow := makeArrow(start, end)
+ for a in arrow repeat curve(sp,a)
+ angle := angle + 2*%pi/n
+ makeViewport3D(sp,title)$VIEW3D
+
+
+
+
+
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}