(* ::Package:: *) BeginPackage["quadrisecant`"] (* version 1.0 *) (* variables *) KVS; (* vertices of the knot *) QSS; (* quadrisecants of the knot *) K14; (* the pre-inputed knot *) K14Generic; OQSS; (* the quadisecant points in the order along the knot *) (* functions *) QuadriInit; InputKnot; DrawKnot; CheckGeneralPosition; GetQuadrisecantsForEdges; GetQuadrisecantsForKnot; DrawQuadrisecantApproximation; Begin["`Private`"] CearSymbols[] := Module[ {}, Clear[ KVS, K14, QSS, OQSS ]; Clear[ QuadriInit, InputKnot, DrawKnot, CheckGeneralPosition, GetQuadrisecantsForEdges, GetQuadrisecantsForKnot, DrawQuadrisecantApproximation ]; ] QuadriInit[] := Module[ {}, K14 = {{-(3/5),-(1/5),0},{-(19/25),11/50,-(99/25)},{228/25,-(66/25),-(112/25)},{143/20,-(121/40),-(109/20)},{-(13/10),11/20,-(61/10)},{-1,1/10,-(171/20)},{10,-1,-8},{10,-1,1},{28/5,6/5,-(1/10)},{81/10,1/20,-(21/20)},{59/10,-(21/20),1/20},{12,-(11/5),-(33/10)},{12,1/5,3/10},{6,2,0}}; ] (* check whether the knot is in general position *) CheckGeneralPosition[] := Module[ {i, j, k, A, B, C, D, E, F, vnum}, vnum = Length[KVS]; (*check whether any four vertices are coplanar*) For[i=1, i