0
$\begingroup$

I have a Bézier surface and its parameters are u and v. The partial differentiation with u as variable gives me a vector in the direction of u. I need to plot this vector.

I plugged in a particular value of u and v and got my partial derivative vector as {0, 1, 0.7}. How do I plot this vector on my surface as an arrow pointing in direction of u?

$\endgroup$
5
$\begingroup$

If you give us your equation, we can plot it directly. In the meantime...

myscalarField = Sin[x] - y^2 - z;
myvectorField = D[myscalarField, {{x, y, z}}];
v = VectorPlot3D[myvectorField, 
       {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   VectorPoints -> 25, 
   VectorScale -> {0.1, Scaled[0.5]}, 
   RegionFunction -> 
        Function[{x, y, z}, -0.1 <= myscalarField <= 0.1]];
c = ContourPlot3D[
   myscalarField == 0, 
       {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
       Mesh -> None, 
   ContourStyle -> Opacity[0.5, Green]];
Show[v, c]

enter image description here

or... for a single vector:

myscalarField = Sin[x] - y^2 - z;
myvectorField = D[myscalarField, {{x, y, z}}];
c = ContourPlot3D[
   myscalarField == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
   Mesh -> None,
   ContourStyle -> Opacity[0.5, Green]];
v = Graphics3D[{Red, 
    Arrow[{beginvec = {Sin[0], 0^2, Sin[0] - 0^2}, 
      beginvec + {.5, .5, .5}}]}];
Show[c, v]
$\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.