(n_turns)
return [np.cos(phi) * (1 + 0.5*np.cos(n_turns*phi)),
            np.sin(phi) * (1 + 0.5*np.cos(n_turns*phi)),
            0.5*np.sin(n_turns*phi)]
The function creating the x, y, z coordinates needed to plot
The function creating the x, y, z coordinates needed to plot
The function creating the x y z coordinates needed to plot
def curve(n_turns):
    "The function creating the x, y, z coordinates needed to plot"
    phi = np.linspace(0, 2*np.pi, 2000)
    return [np.cos(phi) * (1 + 0.5*np.cos(n_turns*phi)),
            np.sin(phi) * (1 + 0.5*np.cos(n_turns*phi)),
            0.5*np.sin(n_turns*phi)]
def curve ( n_turns ) : phi = np . linspace ( 0 , 2 * np . pi , 2000 ) return [ np . cos ( phi ) * ( 1 + 0.5 * np . cos ( n_turns * phi ) ) , np . sin ( phi ) * ( 1 + 0.5 * np . cos ( n_turns * phi ) ) , 0.5 * np . sin ( n_turns * phi ) ]