@Rouben Rostamian
I have done your method:
restart;
with(LinearAlgebra);
with(plots);
assume(t, real);
K := plot3d(1, theta = 0 .. 2*Pi, phi = 0 .. Pi, coords = spherical):
f := (theta, phi) -> (cos(theta)*sin(phi), sin(theta)*sin(phi), cos(phi)):
P := pointplot3d([[f(Pi/4, Pi/8)], [f(0, Pi/8)], [f(Pi/4, (3*Pi)/8)]], color = [black, white, white], symbol = solidsphere):
A := <f(0, Pi/8)>
B := <f(Pi/4, (3*Pi)/8)>
N := simplify(CrossProduct(A, B))
N1 := simplify(N/Norm(N))
M := simplify(CrossProduct(N1, A))
A*cos(t) + M*sin(t)
Vector[column](3, [cos(t)*sin(1/8*Pi) + sin(t)*(-1 + 2*sqrt(2))*cos(1/8*Pi)/(1 + sqrt(2)), 2*sin(t)*cos(1/8*Pi)*sqrt(2)/(1 + sqrt(2)), cos(t)*cos(1/8*Pi) + sin(t)*(1 - 2*sqrt(2))*sin(1/8*Pi)/(1 + sqrt(2))])
S2 := display(spacecurve([cos(t)*sin(t + Pi/8), sin(t + Pi/8)*sin(t), cos(t + Pi/8)], t = 0 .. 2*Pi, thickness = 3, color = green), spacecurve([cos(t)*sin(Pi/8) + sin(t)*(-1 + 2*sqrt(2))*cos(Pi/8)/(1 + sqrt(2)), 2*sin(t)*cos(Pi/8)*sqrt(2)/(1 + sqrt(2)), cos(t)*cos(Pi/8) + sin(t)*(1 - 2*sqrt(2))*sin(Pi/8)/(1 + sqrt(2))], t = 0 .. 2*Pi, thickness = 3, color = green))
