TubePlotToolsΒΆ
tube.spad line 52 [edit on github]
Tools for constructing tubes around 3-dimensional parametric curves.
- *: (DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
s * p
returns a point whose coordinates are the scalar multiple of the pointp
by the scalars
, preserving the color, or fourth coordinate, ofp
.
- +: (Point DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
p + q
computes and returns a point whose coordinates are the sums of the coordinates of the two pointsp
andq
, using the color, or fourth coordinate, of the first pointp
as the color also of the pointq
.
- -: (Point DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
p - q
computes and returns a point whose coordinates are the differences of the coordinates of two pointsp
andq
, using the color, or fourth coordinate, of the first pointp
as the color also of the pointq
.
- cosSinInfo: Integer -> List List DoubleFloat
cosSinInfo(n)
returns the list of lists of values forn
, in the form:[[cos(n - 1) a, sin(n - 1) a], ..., [cos 2 a, sin 2 a], [cos a, sin a]]
wherea = 2 pi/n
. Note:n
should be greater than 2.
- cross: (Point DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
cross(p, q)
computes the cross product of the two pointsp
andq
using only the first three coordinates, and keeping the color of the first pointp
. The result is returned as a point.
- dot: (Point DoubleFloat, Point DoubleFloat) -> DoubleFloat
dot(p, q)
computes the dot product of the two pointsp
andq
using only the first three coordinates, and returns the resulting DoubleFloat.
- loopPoints: (Point DoubleFloat, Point DoubleFloat, Point DoubleFloat, DoubleFloat, List List DoubleFloat) -> List Point DoubleFloat
loopPoints(p, n, b, r, lls)
creates and returns a list of points which form the loop with radiusr
, around the center point indicated by the pointp
, with the principal normal vector of the space curve at pointp
given by the point(vector)n
, and the binormal vector given by the point(vector)b
, and a list of lists,lls
, which is the cosSinInfo of the number of points defining the loop.
- point: (DoubleFloat, DoubleFloat, DoubleFloat, DoubleFloat) -> Point DoubleFloat
point(x1, x2, x3, c)
creates and returns a point from the three specified coordinatesx1
,x2
,x3
, and also a fourth coordinate,c
, which is generally used to specify the color of the point.
- unitVector: Point DoubleFloat -> Point DoubleFloat
unitVector(p)
creates the unit vector of the pointp
and returns the result as a point. Note:unitVector(p) = p/|p|
.