Skip to content

Instantly share code, notes, and snippets.

@mick001
Created August 29, 2015 10:43
Show Gist options
  • Save mick001/705c57758c553c5e2422 to your computer and use it in GitHub Desktop.
Save mick001/705c57758c553c5e2422 to your computer and use it in GitHub Desktop.
Volume of solids of revolution: the cone. Part 1. Full article at: http://www.firsttimeprogrammer.blogspot.com/2015/03/volume-of-solids-of-revolution-cone.html
% Solid of revolution %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms x
syms y
% Cone height
h = 10;
% Our generator function
y1 = @(x) 1/2*x;
% Our generator function raised to the 2nd power
y2 = @(x) (1/2*x)^2;
% Volume of the cone (radius is implicitly 5)
v = pi * int(y2,x,0,h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment