[solved] Need a hint about volume calculation of sphere.
-
- Posts: 8631
- Joined: May 28, 2005 3:28
- Contact:
[solved] Need a hint about volume calculation of sphere.
I know the volume of a sphere ;-)
but if i cut a sphere in two individual parts how to calculate the weight/volume of this two parts ?
I need to know how many of a floating sphere are over and under whater.
I know the physics (forces act on the sphere in water and air) only the volume is currently the problem.
The result should be for example 20% are under and 80% over the water line.
water line y = 0
sphere y position = -2.123
sphere radius = 4
How many percent of the sphere are over/under the water line ?
Thank you and sorry about my english.
Joshy
but if i cut a sphere in two individual parts how to calculate the weight/volume of this two parts ?
I need to know how many of a floating sphere are over and under whater.
I know the physics (forces act on the sphere in water and air) only the volume is currently the problem.
The result should be for example 20% are under and 80% over the water line.
water line y = 0
sphere y position = -2.123
sphere radius = 4
How many percent of the sphere are over/under the water line ?
Thank you and sorry about my english.
Joshy
Last edited by D.J.Peters on Jul 08, 2010 17:43, edited 2 times in total.
Hey Joshy,
I think the English term you are looking for is: "The volume of a dome".
Normally a dome is just half a sphere, which is easy to calculate the volume of. But for other domes, that aren't half spheres you'll need the following:
- http://en.wikipedia.org/wiki/Dome_(mathematics)
I think the English term you are looking for is: "The volume of a dome".
Normally a dome is just half a sphere, which is easy to calculate the volume of. But for other domes, that aren't half spheres you'll need the following:
- http://en.wikipedia.org/wiki/Dome_(mathematics)
-
- Posts: 8631
- Joined: May 28, 2005 3:28
- Contact:
hello voltage thanx but i'm not sure is it the right you posted.
i think if i get the real percent i can calculate the volume under/over the water line.
It's simple for a box but i don't find the percent for a sphere.
vince can you fix my wrong first try please ?
thank you
Joshy
i think if i get the real percent i can calculate the volume under/over the water line.
It's simple for a box but i don't find the percent for a sphere.
vince can you fix my wrong first try please ?
thank you
Joshy
Code: Select all
function GetPercentUnderWater(WaterLine as single=0, _
SpherePosY as single=0, _
SphereRadius as single=1) as single
dim as single diameter = SphereRadius*2
dim as single yup = SpherePosY+SphereRadius
dim as single ydown = SpherePosY-SphereRadius
if yup<=WaterLine then
' complete under the waterline
return 1.0 ' * 100 = percent
elseif ydown>=WaterLine then
' complete over the waterline
return 0.0 ' * 100 = percent
else
return (WaterLine-ydown)/diameter
end if
end function
print GetPercentUnderWater(0, 0.0 ,1)*100
print GetPercentUnderWater(0,-0.25,1)*100
print GetPercentUnderWater(0,-0.50,1)*100
print GetPercentUnderWater(0,-0.75,1)*100
print GetPercentUnderWater(0,-2.00,1)*100
sleep
-
- Posts: 147
- Joined: May 24, 2009 23:13
- Location: Texas, United States, Planet Earth
- Contact:
-
- Posts: 8631
- Joined: May 28, 2005 3:28
- Contact:
D.J.Peter's has proven his worth on these forums 1 million times over.
I assume that the problem is not his maths, or programming ability, but his English.
Here's another link that I found DJ.
http://answers.yahoo.com/question/index ... 102AAB5kZV
With the specific formula: pi*h/6(3r^2+h^2)
Cheers
Volt
I assume that the problem is not his maths, or programming ability, but his English.
Here's another link that I found DJ.
http://answers.yahoo.com/question/index ... 102AAB5kZV
With the specific formula: pi*h/6(3r^2+h^2)
Cheers
Volt
-
- Posts: 2655
- Joined: Aug 28, 2008 10:54
- Location: new york
Hey Joshy,
I've been researching coordinate systems...
http://mathworld.wolfram.com/BicyclideCoordinates.html
Might be useful. I don't know.
I've been researching coordinate systems...
http://mathworld.wolfram.com/BicyclideCoordinates.html
Might be useful. I don't know.
Per one of my references the volume of a spherical cap = (pi*h/6*(3*r^2+h^2)).
But it's apparently not valid for h > r, so you would also need to calculate the volume for the full sphere.
But it's apparently not valid for h > r, so you would also need to calculate the volume for the full sphere.
Code: Select all
dim as double v1,v2,v3,r=1,h=1,pi=atn(1)*4
'' full sphere
v1 = 4/3*pi*r^3
print v1
print v1/2
print
'' spherical cap
v2 = (pi*h/6*(3*r^2+h^2))
print v2
print
h = 1.001
v2 = (pi*h/6*(3*r^2+h^2))
h = 0.999
v3 = (pi*h/6*(3*r^2+h^2))
print v2+v3
h = 1.25
v2 = (pi*h/6*(3*r^2+h^2))
h = 0.75
v3 = (pi*h/6*(3*r^2+h^2))
print v2+v3
sleep
Code: Select all
4.18879020478639
2.094395102393195
2.094395102393195
4.188793346379044
4.385139745635753
If H is the height of a dome, the volume is pi (r H^2 - (1/3) H^3). That's based on the reference I gave but I have also confirmed this by doing the math.
Note that some references use the distance h from the equator to the bottom of the dome instead. h + H = r
Note special cases:
H=0, V = 0
H = r, V = (2/3) pi r^3 (half sphere)
H = 2 r, V = (4/3) pi r^3 (full sphere)
Note that some references use the distance h from the equator to the bottom of the dome instead. h + H = r
Note special cases:
H=0, V = 0
H = r, V = (2/3) pi r^3 (half sphere)
H = 2 r, V = (4/3) pi r^3 (full sphere)
-
- Posts: 8631
- Joined: May 28, 2005 3:28
- Contact:
-
- Posts: 1009
- Joined: Oct 11, 2008 7:42
- Location: ABQ, NM
- Contact:
Holy crap this doesn't look like a coordinate system, it looks like torusii, toruses, torii, whatever.. and .. weird crap..rolliebollocks
Master
PostPosted: Jul 08, 2010 4:01 Post subject: Reply with quote
Hey Joshy,
I've been researching coordinate systems...
http://mathworld.wolfram.com/BicyclideCoordinates.html
Might be useful. I don't know.
Coordinate system with a view!
I'm not joking this time, this stuff looks deep, and I don't understand what it could be used for, except maybe higher dimension stuff, even THAT I don't understand either.
~Kiyote!
P.S. To whoever,.. I will try to knock off so many dumb puns.[/quote]