> restart:

> with(plots):
with(linalg):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> assume (u,real); Forteller Maple at u og v er reelle tall (ikke komplekse)
assume (v,real);

> x := (4-v*sin(u/2))*sin(u); Parametriseringen
y := (3-v*sin(u/2))*cos(u);

z := v*cos(u/2);

x := (4-`v`*sin(1/2*`u`))*sin(`u`)

y := (3-`v`*sin(1/2*`u`))*cos(`u`)

z := `v`*cos(1/2*`u`)

> a := 0; b := 2*Pi; Parameterintervallene for u og v
c := -1; d := 1;

a := 0

b := 2*Pi

c := -1

d := 1

> Flaten := plot3d([x,y,z],u=a..b,v=c..d,grid=[20,4],projection=0.9,scaling=constrained): Plotter flaten

> Ru := [diff(x,u),diff(y,u),diff(z,u)]; Regner ut partiellderiverte av posisjonsvektoren R
Rv := [diff(x,v),diff(y,v),diff(z,v)];

Ru := [-1/2*`v`*cos(1/2*`u`)*sin(`u`)+(4-`v`*sin(1/2*`u`))*cos(`u`), -1/2*`v`*cos(1/2*`u`)*cos(`u`)-(3-`v`*sin(1/2*`u`))*sin(`u`), -1/2*`v`*sin(1/2*`u`)]

Rv := [-sin(1/2*`u`)*sin(`u`), -sin(1/2*`u`)*cos(`u`), cos(1/2*`u`)]

> N := (a,b) -> crossprod(subs({u=a,v=b}, Rv),subs({u=a,v=b}, Ru)); Regner ut kryssproduktet, dvs. en normalvektor N til flaten

N := proc (a, b) options operator, arrow; crossprod(subs({u = a, v = b}, Rv), subs({u = a, v = b}, Ru)) end proc

> R := (a,b) -> [subs({u=a,v=b}, x), subs({u=a,v=b}, y), subs({u=a,v=b}, z)];

R := proc (a, b) options operator, arrow; [subs({u = a, v = b}, x), subs({u = a, v = b}, y), subs({u = a, v = b}, z)] end proc

> Npil := (a,b) -> arrow( R(a,b), N(a,b), color=red):

> n := 30;

n := 30

> animasjon := seq( display(Flaten,Npil(2*Pi*i/n,0),scaling=constrained),i=0..n-1):

> display(animasjon, insequence=true);

[Plot]

> display(animasjon);

[Plot]

> n := 30;

n := 30

> FlatenAnimert := seq(plot3d([(4-v*sin(u/2*i/n))*(-(1-i/n)* (u-Pi)/2 + (i/n)*sin(u)), (3-v*sin(u/2*i/n))*(i/n)*cos(u), v*cos(u/2*i/n)], u=a..b, v=c..d, grid=[20,4], projection=0.9, scaling=constrained), i=0..n):

> display(FlatenAnimert,insequence=true);

[Plot]

>