Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help in drawing planes in mathematica

  1. Oct 11, 2009 #1
    Hi,

    I am trying to draw a plane that is normal to a given vector. I want to enter to the normal in polar coordinates so that I can manipulate the Theta and Phi and see how various planes cut the (111) planes in silicon crystal. Help would be much appreciated.

    Thanks in advance

    Cheers
     
  2. jcsd
  3. Oct 11, 2009 #2

    Hepth

    User Avatar
    Gold Member

    Plane[\[Theta]_, \[Phi]_] = (-Cos[\[Phi]] Sin[\[Theta]] x -
    Sin[\[Phi]] Sin[\[Theta]] y)/Cos[\[Theta]];
    Plot3D[Plane[0.4, 0.2], {x, -1, 1}, {y, -1, 1},
    AxesLabel -> Automatic, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}},
    BoxRatios -> {1, 1, 1}]


    is what id try to start with.
     
  4. Oct 11, 2009 #3
    Thanks a lot for your help. I went along with what you suggested and made some changes to go along. Here is the code that I did.


    Manipulate[
    Plot3D[z = (-Cos[\[Phi] Degree] Sin[\[Theta] Degree] x -
    Sin[\[Phi] Degree] Sin[\[Theta] Degree] y +
    r Sin[\[Theta] Degree] Cos[\[Phi] Degree])/
    Cos[\[Theta] Degree], {x, -1, 1}, {y, -1, 1},
    PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, BoxRatios -> {1, 1, 1},
    Mesh -> None]], {{\[Theta], 0, "\[Theta]"}, 0, 180, 0.1,
    Appearance -> "Labeled"},
    {{\[Phi], 0, "\[Phi]"}, 0, 180, 0.1, Appearance -> "Labeled"},
    {{r, 0.5, "R"}, 0, 1, 0.1, Appearance -> "Labeled"}]

    Thanks again.
     
  5. Oct 12, 2009 #4
    I have a question if any one can answer this. I wrote down the equation for a plane in the post above. But what happens is that if I keep Theta = 0, any changes in Phi and R are not displayed, i.e., there is no effect if I change either one of them. But if I have a non-zero Theta, the changes in Phi and R are visible in the visual. This is odd. Is there anything that I am missing?? Thanks in advance.

    Cheers
     
  6. Oct 12, 2009 #5

    Hepth

    User Avatar
    Gold Member

    No, remember theta is the angle off of the upward Z axis, and phi is the angle ABOUT the Z axis. So if theta is zero, nothing should happen, because the vector is pointing up and revolving around itself, which is nothing.
    R shouldn't change anything because a plane is defined by its normal unit vector, not the magnitude.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help in drawing planes in mathematica
Loading...