using following code, two spheres are intersected. i want to find the intersected volume which is circle. The graph shows the intersected spheres. Thanks for all cooperation in advance.
radius = 10; numPoints = 1000; % Use a large value.
% Get a 3-by-numPoints list of (x, y, z) coordinates.
r = randn(3, numPoints);r = bsxfun(@rdivide, r, sqrt(sum(r.^2,1)));r = radius * r;x = r(1,:) +3 ; y = r(2,:)+2; z = r(3,:)+4; figure(1)scatter3(x, y, z);axis square; % Make sure the aspect ratio is maintained as it's displayed and rotated.
xlabel('X', 'FontSize', 20);ylabel('Y', 'FontSize', 20);zlabel('Z', 'FontSize', 20);% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);%
%msgbox('Now use the circular arrow icon on the toolbar to rotate the sphere.');
%% 2nd sphere
radius = 13; numPoints = 1000; % Use a large value.% Get a 3-by-numPoints list of (x, y, z) coordinates.r = randn(3, numPoints);r = bsxfun(@rdivide, r, sqrt(sum(r.^2,1)));r = radius * r;% Extract the x, y, and z coordinates from the array.
x = r(1,:)+13; y = r(2,:)+12; z = r(3,:)+11; % Display the shell of points
hold onscatter3(x, y, z);axis square; % Make sure the aspect ratio is maintained as it's displayed and rotated.xlabel('X', 'FontSize', 20);ylabel('Y', 'FontSize', 20);zlabel('Z', 'FontSize', 20);% Enlarge figure to full screen.set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
Best Answer