size of surfnorm vectors

1 view (last 30 days)
lorenzo donadio
lorenzo donadio on 6 Nov 2016
Commented: lorenzo donadio on 8 Nov 2016
how can I introduce a max length to the vectors plotted by surfnorm or at least scale them?, I cant finde the rigth documentation to do it, thanks.
  3 Comments
Walter Roberson
Walter Roberson on 7 Nov 2016
The vectors produced by surfnorm are not normalized. That is, they are not unit vectors, do not generally have length 1.
lorenzo donadio
lorenzo donadio on 8 Nov 2016
what I need is that vectors plotted by quiver or surfnorm to not have a length greater than a maximum value, but i dont want vectors smaller than that value to be scaled, is that possible?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 7 Nov 2016
With normalizing:
[nx, ny, nz] = surfnorm(x, y, z);
L = sqrt(nx.^2 + ny.^2 + nz.^2);
quiver3( x, y, z, nx./L, ny./L, nz./L )
  1 Comment
lorenzo donadio
lorenzo donadio on 8 Nov 2016
Edited: lorenzo donadio on 8 Nov 2016
thanks that's very helpful, but i need vectors plotted by quiver or surfnorm to not have a length greater than a maximum value, but i dont want vectors smaller than that value to be scaled

Sign in to comment.

More Answers (0)

Categories

Find more on Vector Fields in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!