1
$\begingroup$

I would like to rotate a plane by $k$ degrees about an arbitrary axis. How should I do it using RotationTransform?


hmm i realise if I do the following

F[x, y] := 0;
Plot3D[F[x, y], {x, -5, 5}, {y, -5, 5}, AxesLabel -> {x, y, z}]

I can define a plane as below, but how do I bound the extent of the plane? It seems to go on infinitely.

I tried something like this but it didnt work:

F[x, y] := 0 && -2 <= x <= 2 && -2 <= y <= 2

enter image description here

I then set up a function to perform the rotation about the y-axis through a point:

G[x, y] := RotationTransform[Pi/8, {0, 1, 0}, {0, 0, 0}]

But strangely nothing appears. Anyone knows whats going on here?

$\endgroup$
  • $\begingroup$ What's the way you are describing this plane? parametric vector, etc. $\endgroup$ – Kuba Oct 10 '14 at 6:18
  • $\begingroup$ I'm currently using a xz plane which should be described by y=0. how could i rotate it about an arbitrary point about the y axis? $\endgroup$ – Corse Oct 10 '14 at 6:27
3
$\begingroup$

Another approach:

Manipulate[
 Graphics3D[{GeometricTransformation[#, 
      RotationTransform[
       angle Degree, {b, c, d}]] & /@ {InfinitePlane[{{0, 0, 0}, {1, 
        0, 0}, {0, 1, 0}}], Arrow[{{0, 0, 0}, {0, 0, 1}}]}, 
   InfiniteLine[{0, 0, 0}, {b, c, d}]}, 
  PlotRange -> Table[{-3, 3}, {3}]], {angle, 0, 360, 
  Appearance -> "Labeled"},
 Delimiter, 
 Style["Rotation Axis", Bold], {{b, 0, "axis x"}, 0, 
  1}, {{c, 0, "axis y"}, 0, 1}, {{d, 0.01, "axis z"}, 0, 1}]

enter image description here

$\endgroup$
5
$\begingroup$

For a starter

Manipulate[Graphics3D[{EdgeForm[None], Opacity[.3],
   Green, poly = Polygon[.5 {{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}}],
   Polygon[.5 {{-1, 0, -1}, {-1, 0, 1}, {1, 0, 1}, {1, 0, -1}}],
   Polygon[.5 {{0, -1, -1}, {0, -1, 1}, {0, 1, 1}, {0, 1, -1}}],
   EdgeForm[None], Opacity[0.7], 
   {Red, GeometricTransformation[poly, RotationTransform[t Pi/8, axis, {px, py, pz}]]},
   PointSize[.05], Opacity[1], Black, Sphere[{px, py, pz}, .05]},
   Lighting -> "Neutral", ImageSize -> 400, SphericalRegion -> True, Boxed -> False],
 {{axis, {1, 0, 0}}, {{1, 0, 0} -> "x", {0, 1, 0} -> "y", {0, 0, 1} -> "z"}},
 {{px, 0}, -1, 1}, {{py, 0}, -1, 1}, {{pz, 0}, -1,  1}, Delimiter,
 {{t, 0}, -8, 8}]

enter image description here

Update:

fX[x, y] := ConditionalExpression[0, -4 <= x <= 4 && -4 <= y <= 4];
Manipulate[plt1 = Show[Plot3D[fX[x, y], {x, -6, 6}, {y, -6, 6}, 
    AxesLabel -> {x, y, z},
    Evaluated -> True, Mesh -> None, AxesOrigin -> {0, 0, 0},
    PlotStyle -> Directive[Opacity[.5], Blue], 
    PlotRange -> {{-6, 6}, {-6, 6}, {-6, 6}},
    Lighting -> "Neutral", ImageSize -> 400,
    SphericalRegion -> True, PerformanceGoal -> "Quality", BoxRatios -> 1], 
   Graphics3D[{PointSize[.05], Red, Sphere[{px, py, pz}, .2]}]];
 MapAt[GeometricTransformation[#,
    RotationTransform[t Pi/8, axis, {px, py, pz}]] &, plt1, {1}],
 {{axis, {1, 0, 0}}, {{1, 0, 0} -> "x", {0, 1, 0} -> "y", {0, 0, 1} -> "z"}},
 {{px, 0}, -1, 1}, {{py, 0}, -1, 1}, {{pz, 0}, -1, 1},
 Delimiter, {{t, 0}, -8, 8}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.