# 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 point`p`

by the scalar`s`

, preserving the color, or fourth coordinate, of`p`

.

- +: (Point DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
`p + q`

computes and returns a point whose coordinates are the sums of the coordinates of the two points`p`

and`q`

, using the color, or fourth coordinate, of the first point`p`

as the color also of the point`q`

.

- -: (Point DoubleFloat, Point DoubleFloat) -> Point DoubleFloat
`p - q`

computes and returns a point whose coordinates are the differences of the coordinates of two points`p`

and`q`

, using the color, or fourth coordinate, of the first point`p`

as the color also of the point`q`

.

- cosSinInfo: Integer -> List List DoubleFloat
`cosSinInfo(n)`

returns the list of lists of values for`n`

, in the form:`[[cos(n - 1) a, sin(n - 1) a], ..., [cos 2 a, sin 2 a], [cos a, sin a]]`

where`a = 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 points`p`

and`q`

using only the first three coordinates, and keeping the color of the first point`p`

. The result is returned as a point.

- dot: (Point DoubleFloat, Point DoubleFloat) -> DoubleFloat
`dot(p, q)`

computes the dot product of the two points`p`

and`q`

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 radius`r`

, around the center point indicated by the point`p`

, with the principal normal vector of the space curve at point`p`

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 coordinates`x1`

,`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 point`p`

and returns the result as a point. Note:`unitVector(p) = p/|p|`

.