I am preparing an illustration for the lecture on differential geometry. In this demonstration I am illustrating the Monge parameterization of the surface:

R = {xx, yy, 55 + xx^2 - xx^3 - 2*yy^2}; (* This is the surface *)
e1 = D[R, xx]; (* e1 and e2 are the vectors tangent to the surface *)
e2 = D[R, yy];
n = Cross[e1, e2]/Sqrt[e1.e1*e2.e2 - (e1.e2)^2]; (* This is the unit vector normal to the surface *)

We can easily check that the unit vector n is orthogonal to the both vectors e1 and e2:

 n.e1 // Simplify
    n.e2 // Simplify

   (* 0

    0  *)

and that it is, indeed, a unit vector:

n.n // Simplify
(*  1  *)

Now I collect all this into the demonstration:

 (* Definitions *)

 R = {xx, yy, 55 + xx^2 - xx^3 - 2*yy^2}; (* This is the surface *)
 e1 = D[R, xx]; (* These are the tangent vectors in the surface *)
 e2 = D[R, yy];
 n = Cross[e1, e2]/
      e2.e2 - (e1.e2)^2]; (* This is the unit vector normal to the \
surface *)
 rule = {xx -> X, yy -> Y};

 (* End of definitions *)


   (* This shows the surface *)
   Plot3D[55 + x^2 - x^3 - 2 y^2, {x, 0, 4}, {y, -2, 2}, 
    PlotStyle -> Opacity[0.3]],

   (* End of the surface *)

   (* This shows the vectors e1, e2 and n *) 
      Arrowheads[0.007], Thick, Red, Arrow[{R, R + e1}],
      Arrowheads[0.003], Arrow[{R, (R + e2)}],
      Arrowheads[0.007], Darker@Green, Arrow[{R, (R + n)}]
      }] /. rule
 , {{X, 1.7}, 0, 4}, {{Y, 0}, -2, 2}]

I show the vectors e1 and e2 in red, and the vector n - in green. To my astonishment, the vector n in the demonstration does not look orthogonal to the vectors e1 and e2:

enter image description here

Why? I tried several alternative representations of n (in addition to the Cross function, but with the same result. It looks like a bug. If it is, do you see a workaround?

  • $\begingroup$ Alexei - you can condense this down to a simpler working exampe :-P pastebin.com/raw/UnCKkZd3 $\endgroup$ – Jason B. Sep 12 '16 at 14:01
  • $\begingroup$ @JasonB That's what I already did. But OK now I removed maximum possible. $\endgroup$ – Alexei Boulbitch Sep 12 '16 at 14:14
  • $\begingroup$ It's not a bug. Your graphics view-port has an anisotropic metric. This distorts the angles between your vectors. $\endgroup$ – m_goldberg Sep 12 '16 at 15:43
  • $\begingroup$ All you have to do in principle is change the order of the displayed objects in Show. See my answer here, for example. This may in fact be a duplicate. $\endgroup$ – Jens Sep 12 '16 at 17:13
  • $\begingroup$ It isn't clear to me that this is a simple mistake, nor that it's a duplicate. The issue is simple enough, that the BoxRatios smushes the arrows in such a way to obfuscate their relationship with each other. But more generally, how would you add a set of vectors to a 3D plot, which will have its own plot range and box ratios, and have their appearance be the same as it would be if you only plot them alone. In essence, you need to rescale the vectors by an amount that depends on the plot range and box ratios of the plot. How to automate that process is a valid question. $\endgroup$ – Jason B. Sep 12 '16 at 17:22

Your Answer

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

Browse other questions tagged or ask your own question.