Incorrect direction for normal using surfnorm(x,y,z)

5 vues (au cours des 30 derniers jours)
Jack
Jack le 20 Août 2014
Commenté : Jack le 20 Août 2014
Im currently working on a vortex lattice code for my thesis and am having issues with the way the MATLAB function [] = surfnorm(x,y,z) produces normal vectors. I have since chosen to use the plane equation for this purpose but was interested in knowing if anyone has had a similar issue or if there is something stupid i've done.
Essentially, I want to produce the normal vector to the surface of a wing with an airfoil camber line describing the z-plane. When entering the x,y,z grid coordinates, surfnorm produces the vectors in the opposite direction (pointing inwards, rather than pointing outwards).
Here are the x,y,z coordinates for an example of a simple, unswept wing with no taper, twist or dihedral.
x =
0 0 0 0 0 0
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
y =
0 0.6000 1.2000 1.8000 2.4000 3.0000
0 0.6000 1.2000 1.8000 2.4000 3.0000
0 0.6000 1.2000 1.8000 2.4000 3.0000
0 0.6000 1.2000 1.8000 2.4000 3.0000
z =
0 0 0 0 0 0
0.0194 0.0194 0.0194 0.0194 0.0194 0.0194
0.0160 0.0160 0.0160 0.0160 0.0160 0.0160
0 0 0 0 0 0
Attached is an image of what happens when surfnorm is used.
Thanks for your help!

Réponse acceptée

Björn
Björn le 20 Août 2014
Try surfnorm(x',y',z').

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by