$SPAD/src/input knot2.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool knot2.output
)set message test on
)set message auto off
)clear all

———-

This is the color function, nothing elaborate for now — * —

--S 1 of 7
f(x:SF):SF == x
--R
--R   Function declaration f : DoubleFloat -> DoubleFloat has been added
--R      to workspace.
--R                                                                   Type: Void
--E 1

———-

Creation of the knot. Only p/q is really used, but p and q correspond to the factors in the notes deriving these knotty things see the notes for detail...too involved to explain here

— * —

--S 2 of 7
[p,q] := [3,5]
--R
--R
--R   (2)  [3,5]
--R                                                  Type: List(PositiveInteger)
--E 2
--S 3 of 7
PQ    := p/q
--R
--R
--R        3
--R   (3)  -
--R        5

--R                                                      Type: Fraction(Integer)
--E 3
--S 4 of 7
l := lcm(p, q) quo p
--R
--R
--R   (4)  5
--R                                                        Type: PositiveInteger
--E 4
--S 5 of 7
maxRange := (odd? l => l * %pi; 2 * l * %pi)
--R
--R
--R   (5)  5%pi
--R                                                                     Type: Pi
--E 5
--S 6 of 7
theRange := 0..maxRange
--R
--R
--R   (6)  0..(5%pi)
--R                                                            Type: Segment(Pi)
--E 6

———-

Create the knot

knot:TUBE := tubePlot(sin t * cos(PQ*t),cos t * cos(PQ*t),cos t * sin(PQ*t),
                      f, theRange, 0.1::SF, 6, "open" )

— * —

--S 7 of 7
v:=draw(curve(sin t * cos(PQ*t),cos t * cos(PQ*t),cos t * sin(PQ*t)), _
        t=theRange, tubeRadius==0.1)
--R
--I   Compiling function %B with type DoubleFloat -> DoubleFloat
--I   Compiling function %D with type DoubleFloat -> DoubleFloat
--I   Compiling function %F with type DoubleFloat -> DoubleFloat
--R   Transmitting data...
--R
--R   (7)  ThreeDimensionalViewport: "cos((3*t)/5)*sin(t)"
--R                                               Type: ThreeDimensionalViewport
--E 7

———-

close the viewport

makeViewport3D(knot, concat ["knot",p::String,q::String])$VIEW3D
close(v)

— * —

)spool
)lisp (bye)

———-

References^{[1] nothing}

6