Appendice 8.B. Coordinate ortogonali nello spazio: costruzione delle figure

Coordinate cilindriche

assi  =  {
Line[{{-5, 0, 0}, {5, 0, 
                0}}],  
Line[{{0, -5, 0}, {0, 5, 
                0}}],  
Line[{{0, 0, -1}, {0, 0, 
                5}}]};

trdBase  =  {Line[{{1, 0, 0}, {0, 0, 0},  {0, 1, 
                0}}],  
Line[{{0, 0, 0}, {0, 0, 
                1}}]};

Show[Graphics3D[assi]];

x1[r_, φ_, z_] :=  r Cos[φ]

x2[r_, φ_, z_] :=  r Sin[φ]

x3[r_, φ_, z_] :=  z

pto[r_, φ_, z_] :=  {r Cos[φ], 
        r Sin[φ], z}

circ[r_, z_, n_, phimax_] :=  
      Table[
 
        Line[
{pto[r, φ, z], 
            pto[r, φ + π/n, z]}],  {φ, 0, 
          phimax - 2  π/n, 2  π/n}]

circUno  =  circ[4, 0, 60, 2  π];

circDue  =  circ[4, 4, 60, 2  π];

Show[Graphics3D[{{RGBColor[1, 0, 0], assi}, circUno,  circDue}], 
        ViewPoint -> {2.838,  1.248,  1.356}];

punto  =  Point[pto[4, π/3, 4]];

arco  =  circ[2, 0, 60, π/3];

lineaUno  =  
        Line[
{pto[4, π/3, 4], {0, 0, 
              0}}];

lineaDue  =  
        Line[
{pto[4, π/3, 4], {x1[4, π/3, 4], 
              x2[4, π/3, 4], 0}, {0, 0, 0}}];

Show[
        Graphics3D[{
{RGBColor[1, 0, 0], 
              assi}, 
{RGBColor[1, 0, 0], 
              PointSize[0.015],  punto}, 
circUno,  
            circDue, 
            arco, 
lineaUno,  
{Dashing[{0.01,  0.01}], 
              lineaDue}}], 
ViewPoint -> {9,  4,  
            2.5}];

Costruiamo il riferimento mobile:

i1[r_, φ_, z_] :=  {Cos[φ], Sin[φ] , 
        0}

i2[r_, φ_, z_] :=  {-Sin[φ] , 
        Cos[φ], 0}

i3[r_, φ_, z_] :=  {0, 0, 1}

triedro[r_, φ_, 
        z_] := {
Line[{pto[r, φ, z], 
            pto[r, φ, z] + 
              i1[r, φ, z]}], 
Line[{pto[
              r, φ, z], 
            pto[r, φ, z] + 
              i2[r, φ, z]}], 
Line[{pto[
              r, φ, z], 
            pto[r, φ, z] + 
              i3[r, φ, z]}]
}

trd  =  triedro[4, π/3, 4];

Show[
        Graphics3D[{
{RGBColor[1, 0, 0], 
              assi}, 
{RGBColor[1, 0, 0], 
              PointSize[0.015],  
              punto}, 
{RGBColor[0, 0, 1], 
              Thickness[0.005], trd,  
              trdBase}, 
circUno,  circDue, arco, 
            lineaDue}], 
ViewPoint -> {7,  3,  3}, 
        Boxed -> False];

Coordinate sferiche

assi  =  {
Line[{{-5, 0, 0}, {5, 0, 
                0}}],  
Line[{{0, -5, 0}, {0, 5, 
                0}}],  
Line[{{0, 0, -5}, {0, 0, 
                5}}]};

trdBase  =  {Line[{{1, 0, 0}, {0, 0, 0},  {0, 1, 
                0}}],  
Line[{{0, 0, 0}, {0, 0, 
                1}}]};

Show[Graphics3D[assi]];

x1[r_, θ_, φ_] :=  
      r Sin[θ] Cos[φ]

x2[r_, θ_, φ_] :=  
      r Sin[θ] Sin[φ]

x3[r_, θ_, φ_] :=  r Cos[θ]

pto[
        r_, θ_, φ_] :=  {r Sin[θ] Cos[φ], r Sin[θ] Sin[φ], 
        r Cos[θ]}

paral[r_, θ_, n_, phimax_] :=  
      Table[
 
        Line[
{pto[r, θ, φ], 
            pto[r, θ, φ + π/n]}],  {φ, 0, 
          phimax - 2  π/n, 2  π/n}]

circUno  =  paral[4, π/2, 60, 2  π];

circDue  =  paral[4, π/3, 60, 2  π];

merid[r_, φ_, n_, thetamax_] :=  
      Table[
 
        Line[
{pto[r, θ, φ], 
            pto[r, θ + π/n, φ]}],  {θ, 0, 
          thetamax - 2  π/n, 2  π/n}]

circTre  =  merid[4, π/3, 60, 2  π];

circQuattro  =   merid[4, 0, 60, 2  π];

circCinque  =   merid[4, π/2, 60, 2  π];

Show[
        Graphics3D[{{RGBColor[1, 0, 0], assi}, circUno,  circDue, circTre}], 
        ViewPoint -> {6,  3,  2}];

punto  =  Point[pto[4, π/3, π/3]];

arcoUno  =  paral[2, π/2, 60, π/3];

arcoDue  =  merid[2, π/3, 60, π/3];

lineaUno  =  
        Line[
{pto[4, π/3, π/3], {0, 0, 
              0}}];

lineaDue  =  
        Line[
{pto[4, π/2, π/3], {0, 0, 
              0}}];

Show[
        Graphics3D[{
{RGBColor[1, 0, 0], 
              assi}, 
{RGBColor[1, 0, 0], 
              PointSize[0.015],  punto}, 
circUno,  
            circDue, circTre, arcoUno,  
            arcoDue, 
lineaUno,  
            lineaDue}], 
ViewPoint -> {9,  3,  2.5}, 
        Boxed -> False];

Costruiamo il riferimento mobile:

i1[r_, θ_, φ_] :=  {Sin[θ] Cos[φ], 
        Sin[θ] Sin[φ] , Cos[θ]}

i2[r_, θ_, φ_] :=  {Cos[θ] Cos[φ], 
        Cos[θ] Sin[φ] , -Sin[θ]}

i3[r_, θ_, φ_] :=  {-Sin[θ], 
        Cos[θ], 0}

triedro[
        r_, θ_, φ_] := {
Line[{pto[
              r, θ, φ], 
            pto[r, θ, φ] + 
              i1[r, θ, φ]}], 
Line[{pto[
              r, θ, φ], 
            pto[r, θ, φ] + 
              i2[r, θ, φ]}], 
Line[{pto[
              r, θ, φ], 
            pto[r, θ, φ] + 
              i3[r, θ, φ]}]
}

trd  =  triedro[4, π/3, π/3];

Show[
        Graphics3D[{
{RGBColor[1, 0, 0], 
              assi}, 
{RGBColor[1, 0, 0], 
              PointSize[0.015],  punto}, 
circUno,  
            circDue, circTre, 
arcoUno,  
            arcoDue, 
lineaUno,  
            lineaDue, 
{RGBColor[0, 0, 1],  
              Thickness[0.004], trd, 
              trdBase}}], 
ViewPoint -> {9,  4,  
            2.5}, Boxed -> False];