I create a (one-dimensional) radius function, such as:
r[h_] := Sin[2.5 h] Exp[-h];
where h
is a "height." Now I create a
RevolutionPlot3D[{0, r[h], h},{h, 0, 1}]
I'd like to compute (and display) three-dimensional normal vectors to the surface, both at points over the full surface, as well as at a point on the surface of my selection.
I can do this through lots of computation of derivatives and such, but I was wondering if there is some functionality of Mathematica that computes the normal elegantly.
NormalsFunction
allows me to specify normals to a surface, but (as far as I can tell) not infer them from a given surface in a RevolutionPlot3D
.
I'm hoping this can be done without resorting to defining a Region
. I could use SliceVectorPlot
(which displays vectors on a surface) but here too, I would need to go through all the computation of derivatives to define the vectors.
Ideally, I would like to simply change my radius function and have all the shape (of course) but also the normals computed directly.
For the experts here, defining a scalar function such as:
scalarField = r[h] - Sqrt[x^2 + y^2];
and then its derivative,
vectorField = Normalize[D[scalarField, {{x, y, z}}]];
doesn't work as the normals from vectorField
are not guaranteed to be perpendicular to the surface, as required.
I could work with all the derivatives, but I was hoping Mathematica would let me avoid all that.