GeoGebra script
translateY = Slider(-3, 3, 0.01, 1, 200)
# Trefoil knot
fx(x) = sin(x) + 2sin(2x)
fy(x) = cos(x) - 2cos(2x) + translateY
fz(x) = -sin(3x)
trefoilKnot = Curve(fx(t), fy(t), fz(t), t, 0, 2pi)
# 2-sphere
sx(x, y) = cos(x) sin(y)
sy(x, y) = sin(x) sin(y)
sz(x, y) = cos(y)
twoSphere = Surface(sx(u, v), sy(u, v), sz(u, v), u, 0, 2pi, v, 0, pi)
# Inversion
norm2(x) = (fx(x))^2 + (fy(x))^2 + (fz(x))^2
trefoilKnotInverted = Curve(fx(t) / norm2(t), fy(t) / norm2(t) , fz(t) / norm2(t), t, 0, 2pi)