Lösungen/Solutions/E1S2AlUe/Ex11

L=Lektion/Leçon-- Sprechstunde/heures de consultation
W=Work/Arbeit/Travail
A  =Anhang/  Annexe / Appendice

Remove["Global`"]

m[x_] := MatrixForm[x]

Aufgabe 1

vecLen[u_] := 
        Sqrt[Flatten[u] . Flatten[u]];
vecLen[{{u1}, {u2}, {u3}}]

φ[u_, v_] := 
        ArcCos[Flatten[u] . 
              Flatten[v]/(vecLen[u] vecLen[
                  v])];
φ[{{u1}, {u2}, {u3}}, {{v1}, {v2}, {v3}}]

e2 = Transpose[{{0, 1, 0}}]; e2 // MatrixForm

e3 = Transpose[{{0, 0, 1}}]; e3 // MatrixForm

Drehmatrizen

dz[φ_] := {{Cos[φ], -Sin[φ], 
            0}, {Sin[φ], Cos[φ], 0}, {0, 0, 
            1}};
dz[φ] // MatrixForm

tzy = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}};
tzy // MatrixForm

tzx = {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}};
tzx // MatrixForm

dy[φ_] := 
        Inverse[tzy] . dz[φ] . tzy; 
dy[φ] // MatrixForm

dx[φ_] := 
        Inverse[tzx] . dz[φ] . tzx; 
dx[φ] // MatrixForm

Matrixaufbau

Remove[x, y, z, x0, y0, z0, r0, a, a1, a2, a3, g]

p[p1_, p2_, p3_] := Transpose[{{p1, p2, p3}}]; 
    p[{p1_, p2_, p3_}] := Transpose[{{p1, p2, p3}}];

r0[x0_, y0_, z0_] := Transpose[{{x0, y0, z0}}];  
    r0[x0, y0, z0] // MatrixForm

a[a1_, a2_, a3_] := 
        Transpose[{{a1, a2, a3}}];
a[a1, a2, a3] // MatrixForm

aProj3[u_] := {u[[1]], 
          u[[2]], {0}}; 
aProj3[a[a1, a2, a3]] // MatrixForm

g[t_] := r0[x0, y0, z0] + t a[a1, a2, a3];  g[t]

g1[t_] := t a[a1, a2, a3];  g1[t]

φ1[a_] := φ[e2, 
          aProj3[a]];
φ1[a[a1, a2, a3]]

rule = {-Sqrt[s1_^2/s2_] + s1_/Sqrt[s2_] -> 0, 
        Sqrt[r1_/r2_] -> Sqrt[r1]/Sqrt[r2]}

az[a_] := dz[φ1[a]] . a;
res1 = az[a[a1, a2, a3]] // Simplify;  
    res1 /. rule // MatrixForm

az[a_, p_, r0_] := dz[φ1[a]] . (p - r0);

?az

aProj12[u_] := {0, 0, u[[3]]}; 
aProj12[a[a1, a2, a3]] // MatrixForm

φ2[a_] := φ[e3, az[a]]; φ2[
        a[a1, a2, a3]] // Simplify

dx[φ2[a[a1, a2, a3]]] // MatrixForm

ax[a_] := dx[φ2[a]] . az[a];
res2 = ax[a[a1, a2, a3]] // FullSimplify; 
    res2 // MatrixForm

ax[a_, p_, r0_] := dx[φ2[a]] . az[a, p, r0];

res2 = 
      res2 /. rule; res2 /. {Sqrt[(h_)^2] -> h} // Together // 
      MatrixForm

axφ[a_, λ_] := 
        dz[λ] . ax[a];
res3 = axφ[a[a1, a2, a3], λ] // FullSimplify; 
    res3 // MatrixForm

axλ[a_, λ_, p_, r0_] := 
        dz[λ] . ax[a, p, r0];

axλInvx[a_, λ_, p_, 
          r0_] := (Inverse[dx[φ2[a]]]) . 
          axλ[a, λ, p, r0];

axλInvxInvz[a_, λ_, p_, 
          r0_] := (Inverse[dz[φ1[a]]]) . 
          axλInvx[a, λ, p, r0];

axλInvxInvzPlusr0[a_, λ_, p_, r0_] := 
        axλInvxInvz[a, λ, p, r0] + r0;

k1 = Transpose[{{1, 1, 1}}];
k2 = 0.5;
k3 = Transpose[{{2, 3, 4}}];
k4 = k1 = Transpose[{{4, 8, 3}}];

Test

axφ[k1, k2, k3, k4]

axλInvx[k1, k2, k3, k4]

axλInvxInvz[k1, k2, k3, k4]

axλInvxInvzPlusr0[k1, k2, k3, k4]

axλDirekt[a_, λ_, p_, r0_] := 
        dz[λ] . (dx[φ[
                  e3, (dz[φ[e2, aProj3[a]]] . 
                      a)]] . (dz[φ[e2, aProj3[a]]] . (p - 
                      r0)));

axλDirekt[k1, k2, k3, k4]

axλInvxDirekt[a_, λ_, p_, r0_] := 
        Inverse[dx[φ[e3, 
                dz[φ[e2, aProj3[a]]] . 
                  a]]] . (dz[λ] . (dx[φ[
                      e3, (dz[φ[e2, aProj3[a]]] . 
                          a)]] . (dz[φ[e2, aProj3[a]]] . (p - 
                          r0))));

axλInvxDirekt[k1, k2, k3, k4]

axλInvxInvzDirekt[a_, λ_, p_, r0_] := 
        Inverse[dz[φ[e2, aProj3[a]]]] . (Inverse[
                dx[φ[e3, 
                    dz[φ[e2, aProj3[a]]] . 
                      a]]] . (dz[λ] . (dx[φ[
                          e3, (dz[φ[e2, aProj3[a]]] . 
                              a)]] . (dz[φ[e2, 
                              aProj3[a]]] . (p - 
                              r0)))));

axλInvxInvzDirekt[k1, k2, k3, k4]

axλInvxInvzPlusr0Direkt[a_, λ_, p_, r0_] := 
        Inverse[dz[φ[e2, aProj3[a]]]] . (Inverse[
                  dx[φ[e3, 
                      dz[φ[e2, aProj3[a]]] . 
                        a]]] . (dz[λ] . (dx[φ[
                            e3, (dz[φ[e2, aProj3[a]]] . 
                                a)]] . (dz[φ[e2, 
                                aProj3[a]]] . (p - r0))))) + 
          r0;

axλInvxInvzPlusr0Direkt[k1, k2, k3, k4]

Zusammen:

Definitionen und Matrix (= " rot " )

m[x_] := MatrixForm[x];
vecLen[u_] := 
        Sqrt[Flatten[u] . Flatten[u]];
φ[u_, v_] := 
        ArcCos[Flatten[u] . 
              Flatten[v]/(vecLen[u] vecLen[
                  v])];
e2 = Transpose[{{0, 1, 0}}];
e3 = Transpose[{{0, 0, 1}}];
dz[φ_] := {{Cos[φ], -Sin[φ], 
            0}, {Sin[φ], Cos[φ], 0}, {0, 0, 
            1}};
tzy = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}};
tzx = {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}};
dy[φ_] := 
        Inverse[tzy] . dz[φ] . tzy;
dx[φ_] := 
        Inverse[tzx] . dz[φ] . tzx;
p[p1_, p2_, p3_] := Transpose[{{p1, p2, p3}}]; 
    p[{p1_, p2_, p3_}] := 
      Transpose[{{p1, p2, p3}}];
r0[x0_, y0_, z0_] := 
        Transpose[{{x0, y0, z0}}]; 
r0[{x0_, y0_, z0_}] := 
        Transpose[{{x0, y0, z0}}];
a[a1_, a2_, a3_] := 
        Transpose[{{a1, a2, a3}}];
a[{a1_, a2_, a3_}] := 
        Transpose[{{a1, a2, a3}}]; 
aProj3[u_] := {u[[1]], 
          u[[2]], {0}}; 
g[t_] := 
        r0[x0, y0, z0] + t a[a1, a2, a3];
g1[t_] := t a[a1, a2, a3];
φ1[a_] := φ[e2, 
          aProj3[a]];

rot[a_, λ_, p_, r0_] := 
        Inverse[dz[φ[e2, aProj3[a]]]] . (Inverse[
                  dx[φ[e3, 
                      dz[φ[e2, aProj3[a]]] . 
                        a]]] . (dz[λ] . (dx[φ[
                            e3, (dz[φ[e2, aProj3[a]]] . 
                                a)]] . (dz[φ[e2, 
                                aProj3[a]]] . (p - r0))))) + 
          r0;
zeige[a_, λ_, p_, r0_] := {m[p], "->", 
        m[rot[a, λ, p, r0]]}

Anwendungen: a= Achsenvektor, λ= Drehwinkel, p= zu drehender Punkt, r0= Verschiebungsvektor der Achse

a = Transpose[{{0, 1, 0}}];
λ = Pi/2;
p = Transpose[{{0, 0, 0}}];
r0 = Transpose[{{1, 0, 0}}];
zeige[a, λ, p, r0]

a = Transpose[{{1, 1, 1}}];
λ = Pi/2;
p = Transpose[{{1, 0, 0}}];
r0 = Transpose[{{0, 0, 0}}];
zeige[a, λ, p, r0] // N

a = Transpose[{{1, 1, 0}}];
λ = Pi/2;
p = Transpose[{{1, 0, 0}}];
r0 = Transpose[{{0, 0, 0}}];
zeige[a, λ, p, r0] // N

a = Transpose[{{0, 1, 0}}];
λ = Pi/2;
p = Transpose[{{1, 0, 0}}];
r0 = Transpose[{{0, 0, 0}}];
zeige[a, λ, p, r0] // N

a = Transpose[{{1, 2, 3}}];
λ = Pi/2;
p = Transpose[{{1, 0, 0}}];
r0 = Transpose[{{4, 4, 4}}];
zeige[a, λ, p, r0] // N