How can I generate a rotationally invariant surface from a profile?

I have a vector, e.g. V = [1 2 3 4 3 2 1], that represents a profile through the center of a rotationally invariant surface. I'm trying to generate a matrix representing the surface.
Alternatively, if there's a spherical cap but all I have is a profile from one edge, through the center, how can I generate the spherical cap from the profile?
Thanks in advance for any help!

 Respuesta aceptada

Matt J
Matt J el 20 de Abr. de 2015
Editada: Matt J el 20 de Abr. de 2015
Something like this, maybe
radius=length(V)-1;
[X,Y]=ndgrid(linspace(0,radius,100););
R=sqrt(X.^2+Y.^2);
surfaceSamples=interp1(0:radius,V,R(:));
surfaceSamples=reshape(surfaceSamples,size(X));
surf(X,Y,surfaceSamples);

3 comentarios

Wow Matt! Thanks!
It solves it except that the code produces just one quadrant of the entire surface. I can try to tweak the code but something tells me you'd do it in 1/1000th the time it'd take me.
This line controls the region sampled. Going from -radius to radius should include all quadrants.
[X,Y]=ndgrid(linspace(-radius,radius,100););
Much appreciated Matt!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Abr. de 2015

Comentada:

el 20 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by