Effacer les filtres
Effacer les filtres

How to convolve a sphere with a shere in 3D and read the surface

1 vue (au cours des 30 derniers jours)
Faraz
Faraz le 18 Oct 2012
I have two spheres A and B, with radius 5 and 10, that are:
theta=linspace(0,2*pi,40); phi=linspace(0,pi,40); [theta,phi]=meshgrid(theta,phi); radius=5; % radius 10 x=radius*sin(phi).*cos(theta); y=radius*sin(phi).*sin(theta); z=radius*cos(phi); mesh(x,y,z)
Everything outside the spheres is 0, and inside is 1.
*Q1 How do I convolve A with B? *
*Q2 How do I read the surface of B (values in the resultant on the coordinates as that of B), after convolution. *
Thanks

Réponses (1)

Matt J
Matt J le 18 Oct 2012
Modifié(e) : Matt J le 18 Oct 2012
*Q1 How do I convolve A with B? *
Make images of A and B (rather than mesh plots) and use CONVN (or fftn if it's better to do fft based convolution) to convolve them.
*Q1 How do I convolve A with B? *
Use INTERPN to interpolate the convolution result at the points you want.

Community Treasure Hunt

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

Start Hunting!

Translated by