Gerechnete Dachformen

Achtung: Auf alten oder schlechten Computern können sich sehr lange Rechenzeiten ergeben!

Vorbereitung: Arcus

Plot[ArcSin[x], {x, -1, 1}];

Plot[ArcCos[x], {x, -1, 1}];

pl1 = 
        Plot3D[2, {x, -1, 1}, {y, -1, 
            1}];
pl1 = 
      Plot3D[2, {x, -1, 1}, {y, -1, 1}, Boxed -> False, 
        Axes -> False]; 
    pl2 = Plot3D[-2, {x, -1, 1}, {y, -1, 1}, Boxed -> False, 
        Axes -> False];
Show[pl1, pl2];
pl3 = 
        Plot3D[(x + y + 6)/2, {x, -1, 1}, {y, -1, 1}, 
          Boxed -> False, 
          Axes -> False];
Show[pl1, pl2, pl3];
Show[pl1, pl2, pl3, 
        ViewPoint -> {0.040,  -5.079,  -0.060}];

Vorbereitung: ParametricPlot

ParametricPlot3D[{x, 2, z}, {x, -2, 2}, {z, -2, 
          2}];

pl4 = 
        ParametricPlot3D[{1, u, v}, {u, -1, 1}, {v, -2, 2}, 
          Boxed -> False, 
          Axes -> False];
Show[pl1, pl2, pl3, pl4, 
        ViewPoint -> {0.040,  -5.079,  -0.060}];
pl5 = 
        ParametricPlot3D[{Cos[u]/2, Sin[u]/2, v}, {u, 0, 2  Pi}, {v, -2, 
            2}, Boxed -> False, 
          Axes -> False];
Show[pl1, pl2, pl3, pl4, pl5, 
        ViewPoint -> {0.040,  -5.079,  -0.060}];

Remove[pl1, pl2, pl3, pl4, pl5]

Vorbereitung: Beispiel Fantasiegebäude

fan1 = 
        ParametricPlot3D[{Cos[z] + Cos[x]/3, Sin[z] + Sin[x]/3, z}, {x, 0, 
            2  Pi}, {z, 0, 4  Pi}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan2 = 
        ParametricPlot3D[{Cos[4  Pi] + (Pi - z) Cos[x]/3/Pi, 
            Sin[4  Pi] + (Pi - z) Sin[x]/3/Pi, 4  Pi + z}, {x, 0, 
            2  Pi}, {z, 0, Pi}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan3 = 
        ParametricPlot3D[{Cos[x]/3, Sin[x]/3, z}, {x, 0, 2  Pi}, {z, 0, 
            4  Pi}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan4 = 
        ParametricPlot3D[{(Pi - z) Cos[x]/3/
                Pi, (Pi - z) Sin[x]/3/Pi, 4  Pi + z/2}, {x, 0, 
            2  Pi}, {z, 0, Pi}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan5 = 
        ParametricPlot3D[{z Cos[x], Sin[x], 0}, {x, 0, 2  Pi}, {z, 0, Pi}, 
          Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan6 = 
        ParametricPlot3D[{z Cos[x], Sin[x], -Pi/2}, {x, 0, 2  Pi}, {z, 
            0, Pi}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
fan7 = 
        ParametricPlot3D[{Pi/ 2 Cos[x], Sin[x], -z}, {x, 0, 2  Pi}, {z, 
            0, Pi/2}, Boxed -> False, Axes -> False, 
          PlotPoints -> 50];
Show[fan1, fan2, fan3, fan4, fan5, fan6, fan7];

Auf Graphik klicken, am Rand mit der lilnkenMaustaste gross ziehen!!!

Dachform

x[u_, v_] := 2  Cos[u + v];
y[u_, v_] := 2  Sin[u - v];
z[u_, v_] := 5 - u^2 - v^2;
p1 = 
        ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, -Pi/2, 
            Pi/2}, {v, -Pi/2, Pi/2}];

p2 = 
        ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, -Pi/2, 
            Pi/2}, {v, 0, Pi}];

Show[p1, p2];

p3 = 
        ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, 0, 
            Pi}, {v, -Pi/2, Pi/2}];

Show[p1, p2, p3];

Table[
        ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, 0, 
            Pi}, {v, -Pi/2, Pi/2}, 
          ViewPoint -> {1.589,  -2.933,  k}], {k, -4, 
          4}];

Amimate selected graphics in "Cell"!!!

x[u_, v_] := 2  Cos[u + v];
y[u_, v_] := 2  Sin[u - v];
z[u_, v_] := 5 - u^2 - v^2;
pp = 
        ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, -Pi, 
            Pi}, {v, -Pi, Pi}];

x[u_, v_] := 2  Cos[u + v];
y[u_, v_] := 2  Sin[u - v];
z[u_, v_] := 5 - u^2 - v^2;
ParametricPlot3D[{x[u, v], y[u, v], z[u, v]}, {u, -2 Pi, 
          2  Pi}, {v, -2 Pi, 2  Pi}];

Solve[x  == 2  Sin[a], {a}]

x[u_, v_] := 2  Cos[u + v];
y[u_, v_] := 2  Sin[u - v];
z[u_, v_] := 5 - u^2 - v^2;

g1 = (u + v == ArcCos[x1/2]);
g2 = (u - v == ArcSin[y1/2]);
Solve[{g1, g2}, {u, v}] // Simplify

f[x1_, y1_] := 
        5 - ((1/2) (+ArcCos[(x1/2)] + 
                    ArcSin[(y1/2)]))^2 - ((1/2) (+ArcCos[(x1/2)] - 
                    ArcSin[(y1/2)]))^2;
pf = 
        Plot3D[f[x1, y1], {x1, -2, 2}, {y1, -2, 2}];

f[x1, y1]

g1 = (u + v == 
            ArcCos[-x1/2]);
g2 = (u - v == ArcSin[y1/2]);
Solve[{g1, g2}, {u, v}] // Simplify

g[x1_, y1_] := 
        5 - ((1/2) (+ArcCos[(x1/2)] + ArcSin[(y1/2)]))^2 - 
          (1/2) (+ArcCos[(x1/2)] - 
                  ArcSin[(y1/2)])^2;
pg = Plot3D[g[x1, y1], {x1, 0, 2}, {y1, 0, 2}];

Show[pp, pf];

Show[pp, pg];

Seitenwand integrieren

p4 = 
        ParametricPlot3D[{x, y, f[x, y]}, {y, -2, 2}, {x, -2, 
            2}];

p5 = 
        ParametricPlot3D[{x, 2, h (f[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];

Show[p4, p5];

Options[ParametricPlot3D]

Show[p4, p5, Boxed -> False];

Show[p4, p5, Boxed -> False, Axes -> False];

Show[p4, p5, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}];

p6 = 
        ParametricPlot3D[{x, -2, h (f[x, -2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];

Show[p4, p5, p6, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}];

<< Graphics`Animation`;
Animate[
        Show[p4, p5, p6, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  theta,  2.000}], {theta, -4, 4, 
          0.2}];

ShowAnimation[
      Table[Show[p4, p5, p6, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  theta,  2.000}], {theta, -4, 4, 
          0.2}]]

tabgraph = 
      Table[Show[p4, p5, p6, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  theta,  2.000}], {theta, -4, 4, 0.2}]; 
    ShowAnimation[tabgraph]

Select the graphics, go to cell, animate selected graphics....

p7 = 
        ParametricPlot3D[{x, 2 + y/1000, f[x, 2]}, {x, -2, 
            2}, {y, -2, 2}];

Mehrere Gebäude

f1[x1_, y1_] := 
        5 - ((1/2) (+ArcCos[(x1/2)] + 
                    ArcSin[(y1/2)]))^2 - ((1/2) (+ArcCos[(x1/2)] - 
                    ArcSin[(y1/2)]))^2;
p4 = 
        ParametricPlot3D[{x + 2, y, f1[x, y]}, {y, -2, 2}, {x, -2, 
            2}];
p5 = 
        ParametricPlot3D[{x + 2, 2, h (f1[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p6 = 
      ParametricPlot3D[{x + 2, -2, h (f1[x, -2] + 2) - 2}, {h, 
          0, 1}, {x, -2, 2}]; 
    s1 = Show[p4, p5, p6, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}];

f2[x1_, y1_] := 
        3 - ((1/4) (+ArcCos[
                      x1/2]))^2 - ((1/2) (+ArcCos[(x1/4)] - 
                    ArcSin[(y1/2)]))^2;
p7 = 
        ParametricPlot3D[{x - 2, y, f2[x, y]}, {y, -2, 2}, {x, -2, 
            2}];
p8 = 
        ParametricPlot3D[{x - 2, 2, h (f2[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p9 = 
      ParametricPlot3D[{x - 2, -2, h (f2[x, -2] + 2) - 2}, {h, 
          0, 1}, {x, -2, 2}]; 
    s2 = Show[p7, p8, p9, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}];

Show[s1, s2];

f3[x1_, y1_] := 
        3 - ((1/6) (+ArcCos[x1/2]))^2 - ((1/2) (+ArcSin[
                      (y1/2)]))^2;
p10 = 
        ParametricPlot3D[{x - 2, y - 4, f3[x, y]}, {y, -2, 
            2}, {x, -2, 2}];
p11 = 
        ParametricPlot3D[{x - 2, 2 - 4, h (f3[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p12 = 
      ParametricPlot3D[{x - 2, -2 - 4, 
          h (f3[x, -2] + 2) - 2}, {h, 0, 1}, {x, -2, 2}]; 
    s3 = Show[p10, p11, p12, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}];

Show[s1, s2, s3];

f1[x1_, y1_] := 
        7 - ((1/2) (+ArcCos[(x1/2)] + 
                    ArcSin[(y1/2)]))^2 - ((1/2) (+ArcCos[(x1/2)] - 
                    ArcSin[(y1/2)]))^2;
p4 = 
        ParametricPlot3D[{x + 2, y, f1[x, y]}, {y, -2, 2}, {x, -2, 
            2}];
p5 = 
        ParametricPlot3D[{x + 2, 2, h (f1[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p6 = 
        ParametricPlot3D[{x + 2, -2, h (f1[x, -2] + 2) - 2}, {h, 
            0, 1}, {x, -2, 2}];
f2[x1_, y1_] := 
        4 - ((1/4) (+ArcCos[
                      x1/2]))^2 - ((1/2) (+ArcCos[(x1/4)] - 
                    ArcSin[(y1/2)]))^2;
p7 = 
        ParametricPlot3D[{x - 2, y, f2[x, y]}, {y, -2, 2}, {x, -2, 
            2}];
p8 = 
        ParametricPlot3D[{x - 2, 2, h (f2[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p9 = 
        ParametricPlot3D[{x - 2, -2, h (f2[x, -2] + 2) - 2}, {h, 
            0, 1}, {x, -2, 2}];
f3[x1_, 
          y1_] := (2 - ((1/6) (+ArcCos[
                          x1/2]))^2 - ((1/2) (+ArcSin[
                          (y1/2)]))^2) (1 - 
              x/3);
p10 = 
        ParametricPlot3D[{x - 2, y - 4, f3[x, y]}, {y, -2, 
            2}, {x, -2, 2}];
p11 = 
        ParametricPlot3D[{x - 2, 2 - 4, h (f3[x, 2] + 2) - 2}, {h, 0, 
            1}, {x, -2, 2}];
p12 = 
        ParametricPlot3D[{x - 2, -2 - 4, 
            h (f3[x, -2] + 2) - 2}, {h, 0, 1}, {x, -2, 
            2}];
s1 = 
      Show[p4, p5, p6, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  2.000}]; 
    s2 = Show[p7, p8, p9, Boxed -> False, Axes -> False, 
        ViewPoint -> {2.460,  -1.182,  
            2.000}];
s3 = 
        Show[p10, p11, p12, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  
              2.000}];
Show[s1, s2, s3];

s1 = Show[p4, p5, p6, ViewPoint -> {2.460,  -1.182,  2.000}]; 
    s2 = Show[p7, p8, p9, 
        ViewPoint -> {2.460,  -1.182,  
            2.000}];
s3 = 
        Show[p10, p11, p12, 
          ViewPoint -> {2.460,  -1.182,  
              2.000}];
s4 = Show[s1, s2, s3];

Mehrere Gebäude mit Turm

pRund1 = 
        ParametricPlot3D[{2 + Cos[x], Sin[x], z}, {x, 0, 2  Pi}, {z, 0, 
            2  Pi}];

pRund2 = 
        ParametricPlot3D[{2 + (1 - Sin[z] ) Cos[x], (1 - Sin[z] ) 
              Sin[x], z}, {x, 0, 2  Pi}, {z, 2  Pi, 3.5  Pi}];

pRund2 = 
        ParametricPlot3D[{2 + (1 - Sin[z] ) Cos[x], (1 - Sin[z] ) 
              Sin[x], z}, {x, 0, 2  Pi}, {z, 2  Pi, 2.5  Pi}];

Show[pRund1, pRund2];

pRund1 = 
        ParametricPlot3D[{2 + Cos[x], Sin[x], z}, {x, 0, 2  Pi}, {z, 0, 
            2  Pi}, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];

pRund2 = 
        ParametricPlot3D[{2 + (1 - Sin[z] ) Cos[x], (1 - Sin[z] ) 
              Sin[x], z}, {x, 0, 2  Pi}, {z, 2  Pi, 3.5  Pi}, 
          Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];

s5 = Show[pRund1, pRund2];

s6 = Show[s4, s5];

pRund1 = 
        ParametricPlot3D[{2 + Cos[x], 3 + Sin[x], z}, {x, 0, 2  Pi}, {z, 0, 
            2  Pi}, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];

pRund2 = 
        ParametricPlot3D[{2 + (1 - Sin[z] ) Cos[x], 
            3 + (1 - Sin[z] ) Sin[x], z}, {x, 0, 2  Pi}, {z, 2  Pi, 
            2.5  Pi}, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];

s5 = 
        Show[pRund1, pRund2, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];

s6 = 
        Show[s4, s5, Boxed -> False, Axes -> False, 
          ViewPoint -> {2.460,  -1.182,  2.000}];