2
$\begingroup$

I am trying to write a code for an arrow that points upwards from the center of the circle in a Graphics3D.

Manipulate[
Plot3D[RandomReal[{-0.5, 0.5}]*
UnitStep[(x - a)^2 + (y - b)^2 - 1.5^2], {x, -3, 3}, {y, -3, 3}, 
PlotRange -> All], {a, -1, 1}, {b, -1, 1}]

I want an arrow to point perpendicular from the center of this circle, how can I do that ?

$\endgroup$
  • $\begingroup$ Just use VectorPlot3D. $\endgroup$ – Spawn1701D Apr 25 '13 at 22:20
5
$\begingroup$
Manipulate[
 Show[Plot3D[ RandomReal[{-0.5, 0.5}] UnitStep[(x - a)^2 + (y - b)^2 - 1.5^2], 
                                                 {x, -3, 3}, {y, -3, 3},  PlotRange -> All], 
      Graphics3D[Arrow[{{a, b, 0}, {a, b, 1/2}}]]], 
{a, -1, 1}, {b, -1, 1}]

enter image description here

|improve this answer|||||
$\endgroup$
3
$\begingroup$

Or, to make a bigger point, a solid arrow:

Manipulate[Show[
  Plot3D[
   RandomReal[{-0.5, 0.5}]*UnitStep[(x - a)^2 + (y - b)^2 - 1.5^2],
   {x, -3, 3},
   {y, -3, 3},
   PlotRange -> All],
  Graphics3D[{
    White, Specularity[1],
    Cylinder[{{a, b, 0}, {a, b, 1/2}}, .2],
    Cone[{{a, b, 1/2}, {a, b, 7/8}}, .3]}]],
 {a, -1, 1}, {b, -1, 1}]

plot

|improve this answer|||||
$\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.