Finding an angle for a vector perpendicular (normal) to a surface.

Hey guys, I got a problem for calculating normal vector of a surface. Actually, I need to calculate fluctuation of a surface in the direction of the normal vector. I wrote some codes but I am not sure which one is correct. data are stored in a matrix A=[x,y,z]. For the sake of simplicity we can assume a unit distance for x and y direction(dx=1 and dy=1). I have attached two pictures here. First one presents my 3D surface and second one shows the desired vector(green vector) and angle. If there is any solution, please post it here.
Thank you in advance

 採用された回答

Star Strider
Star Strider 2015 年 1 月 10 日

0 投票

If I understand your Question correctly, the surfnorm function will do what you want.

2 件のコメント

Keyvan jaferzadeh
Keyvan jaferzadeh 2015 年 1 月 11 日
This is what I am exactly looking for. How about Alpha degree? Angle α is defined as the angle between the surface and the horizontal plane.
Star Strider
Star Strider 2015 年 1 月 11 日
Great!
Geometrically, from your diagram, it would seem that alpha would be the same as the negative value of the gradient at that point, and the angle perhaps the atan (or atand) of it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by