(* This explains how to parameterize a torus knot *)

(* We want a curve that wraps p times meridionally for every q times it wraps longitudinally. We begin with the longitudinal circle. It has radius 2 and lies in the xy plane. The factor of q in the argument ensures that as t runs from 0 to 1, we wrap q times around the circle. *)
longitude[q_,t_] := {2Cos[2Pi q t], 2Sin[2 Pi q t], 0}

(* Now we want a circle that lies in the plane perpendicular to the xy plane and goes through the origin and the point longitude[q_,t_]. The factor of p in the argument guarantees that we wrap p times around it as t runs from 0 to 1. This is describes the position of the point on the curve at time t using tangent space coordinates based at the point on the longitude curve.*)
smallCircle[p_,q_,t_] := Cos[2 Pi p t] * (1/2) * longitude[q,t] + Sin[2 Pi p t]*{0,0,1}

(* We now just add the positions of the longitude and the smallCircle point *)

torusKnot[p_,q_,t_] := longitude[q,t] + smallCircle[p,q,t]

(* Here is a plot of the curve for when (p,q) = (3,5) *)

ParametricPlot3D[torusKnot[3,5,t], {t,0,1},PlotRange->{{-4,4},{-4,4},{-4,4}}]