Lösungen/Solutions/
B1S1Ue/Ex15

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

Remove["Global`*"]

vecLen[a_] := Sqrt[a . a]

Ueb/Ex 1      W

Φ1[{x_, y_, z_}] := 
        x + y + z + 1;
Φ1[x_, y_, z_] := 
        x + y + z + 1;
Φ2[x_, y_, z_] := 
        x + y + 3  z - 2;
Φ3[x_, y_, z_] := 
      x + 2  y + 4  z + 10; Φ4[x_, y_, z_] := -x + 
        y + -3 z + 7;

solvP1 = 
      Solve[{Φ2[x, y, z] == 
              0, Φ3[x, y, z] == 
              0, Φ4[x, y, z] == 0}, 
{x, 
            y, z}] // Flatten

OP1 = {x, y, z} /. solvP1

N[OP1]

HNF1[{x_, y_, z_}] := (x + y + z + 1)/Sqrt[3];

d = HNF1[OP1]

N[d]

n1 = {1, 1, 1};

h[t_] := OP1 + t n1

Φ1[h[t]]

tH = Solve[Φ1[h[t]] == 0, {t}] // Flatten

OH = h[t] /. tH

N[OH]

vecLen[a_] := Sqrt[a . a]

vecHP1 = OP1 - OH

h = vecLen[vecHP1]

N[h]

solvP2 = 
      Solve[{Φ1[x, y, z] == 
              0, Φ3[x, y, z] == 
              0, Φ4[x, y, z] == 0}, 
{x, 
            y, z}] // Flatten

OP2 = {x, y, z} /. solvP2

N[OP2]

solvP2 = 
      Solve[{Φ1[x, y, z] == 
              0, Φ3[x, y, z] == 
              0, Φ4[x, y, z] == 0}, 
{x, 
            y, z}] // Flatten

OP2 = {x, y, z} /. solvP2

N[OP2]

solvP3 = 
      Solve[{Φ1[x, y, z] == 
              0, Φ2[x, y, z] == 
              0, Φ4[x, y, z] == 0}, 
{x, 
            y, z}] // Flatten

OP3 = {x, y, z} /. solvP3

N[OP3]

solvP4 = 
      Solve[{Φ1[x, y, z] == 
              0, Φ2[x, y, z] == 
              0, Φ3[x, y, z] == 0}, 
{x, 
            y, z}] // Flatten

OP4 = {x, y, z} /. solvP4

N[OP4]

vecLen[a_] := Sqrt[a . a]

a3 = OP3 - OP2;  a4 = OP4 - OP2;

φ = 
      ArcCos[a3 . a4 /(vecLen[a3]  vecLen[a4])]

N[φ]

A = 1/2 vecLen[a3]  vecLen[a4] *Sin[φ]

N[A]

vol = A h/3

N[%]

Kontr.

Det[{OP2 - OP1, OP3 - OP1, OP4 - OP1}]/6 // Abs

Ueb/Ex 2      W

Ψ[λ_, μ_] := {0, 1, 
          1} + λ {-1, 2, 3} + μ {1, -1, 1}

coordΨsolv = 
      Solve[Ψ[λ, μ] == {x, y, 
              z}, {λ, μ, x}] // Flatten

coordEq = x /. coordΨsolv[[3]]

HNFΨ[{x_, y_, z_}] := (coordEq - x)/
          Sqrt[(4/5)^2 + (1/5)^2 + 1^2];
HNFΨ[{x, y, z}] // Expand

d = 
      HNFΨ[{x, y, z}] /. {x -> 15, y -> 20, 
          z -> 18}

N[%]

n = {-((5 )/(Sqrt[42])), -2 (Sqrt[(2/21)]), (1/(Sqrt[42]))};  
    vecLen[n]

OP0 = {15, 20, 18}

gH[t_] := OP0 + t n;  gH[t]

tH = 
      HNFΨ[{x, y, z}] /. {x -> 15 - ((5 t)/(Sqrt[42])), 
          y -> 20 - 2 (Sqrt[(2/21)]) t, z -> 18 + (t/(Sqrt[42]))}

solv2 = Solve[tH == 0, {t}] // Flatten

OH = gH[t] /. solv2

nOH = N[OH]

HNFΦ[{x, y, z}] /. {x -> -(20/21), y -> (152/21), 
        z -> (445/21)}

g[t_] := {2, -1, 5} + t {1, 1, 1};  g[t]

tS = 
      HNFΨ[{x, y, z}] /. {x -> 2 + t, y -> -1 + t, 
            z -> 5 + t} // Simplify

solv21 = Solve[tS == 0, {t}] // Flatten

OS = g[t] /. solv21

N[OS]

HNFΨ[{x, y, z}] /. {x -> (9/4), y -> -(3/4), 
          z -> (21/4)} // Simplify

vecLen[a_] := Sqrt[a . a]

h = vecLen[OH - OS] // Simplify

N[h]

Ueb/Ex 3      W

Remove["Global`*"]

vecLen[a_] := Sqrt[a . a]

r1 = {2, 1, 3};
a1 = {1, -2, 1};
r2 = {-3, -1, 1}; a2 = {-2, 1, 4};

g1[t_] := r1 + t a1;
g2[t_] := r2 + t a2;

Φ[λ_, μ_] :=  
      1/2 (r1 + 
              r2)  +  λ a1  +  μ a2;  Φ[λ, μ]

solv3 = 
      Solve[ Φ[λ, μ] == {x, y, 
              z}, {λ, μ, x}] // Flatten

solv3[[3]]

coord[x1_, y_, z_] := 
        x1 - x /. solv3[[3]] // Expand;
coord[x1, y, z]

HNF[{x1_, y_, z_}] := (-(1/6) + x1 + ((2 y)/3) + (z/3))/
        Sqrt[(1)^2 + (2/3)^2 + (1/3)^2]

HNF[{x1, y, z}] // Expand

vecLen[{((3 )/(Sqrt[14])), (Sqrt[(2/7)]), (1/(Sqrt[14]))}]