|
Problem
Suppose I have the following two-dimensional space:
Suppose I can fill it with as much water as I want:
How can I find the area the water covers?
Solution
I divided the problem into three parts: when x < r, when x = r and when x > r.
When x < r, the following model applies:
Where:
h = r - x b = SQRT (r ^ 2 - h ^ 2) θ = SIN ^ -1 (b / r)
Therefore:
A1 = (b * h) / 2 A2 = PI * r ^ 2 * θ / 360
A = 2 * (A2 - A1)
When x = r, it is very simple:
A = (PI * r ^ 2) / 2
When x > r, the following model applies:
A1 = (PI * r ^ 2) / 2
h = x - r b = SQRT (h ^ 2 - r ^ 2) A2 = b * h
θ1 = SIN ^ -1 (b / r) θ = 180 - (2 * θ1) A3 = PI * r ^ 2 * θ / 360
A = A1 + A2 + A3
In short, I was able to figure out a set of three equations that explains the change in area as the water level rises. However, is there a better way of tackling this problem? Is there perhaps a single formula that models this behavior?
Thanks!
edit: one guy didn't make it out of algebra 1
|
Area of the sector of the circle of radius 2θ - Area of the triangle with sides r, r and height x - r. And if x > r then: Area of the circle - the previous result.
|
|
On July 13 2011 00:53 Cloud wrote: Area of the sector of the circle of radius 2θ - Area of the triangle with sides r, r and height x - r. And if x > r then: Area of the circle - the previous result. I feel stupid now XD
|
I'm terrible at math and even worse at geometrical stuff,... but the way I'd attempt to solve it (don't know if it's functionally equivalent to what you did) is to pretend the circle wasn't a circle at all, extend it to a rectangle starting from the middle (circle-bisecting radius), then calculate twice the area under the curve under the 'water' and subtract this from twice that entire rectangle... Not sure if you got what I mean, but this pc is going haywire; can't start any .exe right now, so I can't illustrate this in paint.
|
If you know a bit (okay depending on how much you learned it might be advanced) calculus, you can just write either the left or right boundary of the circle as function of x and integrate along the way of x. Multiply that by 2 and you have the right answer for any given x, without the need for clauses.
Might be a bit heavy gear for this easy problem, but sure is more elegant.
/edit: i forgot that you have to piece the upper and lower boundary of the circle together. So this would also need a clause. Maybe someone can do it without one?
|
It really depends on the water quality I think. Wouldn't try that with ordinary tap water. And you have to be careful to not spill any of the water while calculating.
+ Show Spoiler +Please just mention you want to calculate a circle segment, not something about "filling" a 2D-space with a liquid. Yea sorry I'm an engineer who gets paid for hairsplitting. You will find a good set of formulae on Wikipedia btw. For x > r I'd recommend using your x < r method to find out the non-covered area, then substracting from a full circle. Your graphics would also benefit from explicitly labeling the areas you reference in the formulae. Other than that, it looks fine.
|
... thinking
can't you just pretend its a sine wave and get the area under the curve at a given interval, then multiple by two or something?
edit: probably not... but it wouldn't take too much modification for it to work.
|
Peru611 Posts
brain..hurts.. memories of math classes coming back.. argh
|
United States24483 Posts
I integrated the formula sqrt(r^2-x^2) with respect to x from -r to (-r+q) on my calculator where q is your 'x' and then doubled the answer and got:
Area = pi*r^2/2 - (r-q)sqrt(q(2r-q)) - pi*r^2*asin((r-q)/r)/180
|
|
On July 13 2011 01:07 jacen wrote: If you know a bit (okay depending on how much you learned it might be advanced) calculus, you can just write either the left or right boundary of the circle as function of x and integrate along the way of x. Multiply that by 2 and you have the right answer for any given x, without the need for clauses.
Might be a bit heavy gear for this easy problem, but sure is more elegant.
/edit: i forgot that you have to piece the upper and lower boundary of the circle together. So this would also need a clause. Maybe someone can do it without one? Why didn't I think of that!
If I'm not mistaken, this is the integral:
edit: micronesia is right XDD
Sorry, got carried away by y'all's genius.
|
United States24483 Posts
I don't think you can have the variable you are integrating with respect to be one of the bounds in your definite integral lol... choose another letter for x so that you don't have two x's XD
|
I followed your logic and it seems correct. Any formula would probably just confuse me, but this logic is followable and correct.
|
it's obvious that this is a different x can't you see that?
|
On July 13 2011 01:14 ReTrooper wrote:It really depends on the water quality I think. Wouldn't try that with ordinary tap water. And you have to be careful to not spill any of the water while calculating. + Show Spoiler +Please just mention you want to calculate a circle segment, not something about "filling" a 2D-space with a liquid. Yea sorry I'm an engineer who gets paid for hairsplitting. You will find a good set of formulae on Wikipedia btw. For x > r I'd recommend using your x < r method to find out the non-covered area, then substracting from a full circle. Your graphics would also benefit from explicitly labeling the areas you reference in the formulae. Other than that, it looks fine. Thought it would've been more understandable to explain it for what it is n_n
|
On July 13 2011 01:38 EsX_Raptor wrote:Show nested quote +On July 13 2011 01:07 jacen wrote: If you know a bit (okay depending on how much you learned it might be advanced) calculus, you can just write either the left or right boundary of the circle as function of x and integrate along the way of x. Multiply that by 2 and you have the right answer for any given x, without the need for clauses.
Might be a bit heavy gear for this easy problem, but sure is more elegant.
/edit: i forgot that you have to piece the upper and lower boundary of the circle together. So this would also need a clause. Maybe someone can do it without one? Why didn't I think of that! If I'm not mistaken, this is the integral: edit: micronesia is right XDD Sorry, got carried away by y'all's genius.
EDIT: nvm.
|
United Kingdom10823 Posts
However, is there a better way of tackling this problem?
Post on TeamLiquid, and the nerds will help. That seems easier
|
On July 13 2011 01:46 micronesia wrote: I don't think you can have the variable you are integrating with respect to be one of the bounds in your definite integral lol... You wouldn't you? http://en.wikipedia.org/wiki/Definite_integral
But you are right that the bounds of the interval of the integral (r to r-q) are wrong. You have to have bounds in terms of definitive values of x.
Imho the right way would be to integrate from -1 to 1 if the circle has its center on 0 or from 0 to 2 if the center is at x=1.
But i am really to lazy to do it right now
|
United States24483 Posts
On July 13 2011 03:13 jacen wrote:Show nested quote +On July 13 2011 01:46 micronesia wrote: I don't think you can have the variable you are integrating with respect to be one of the bounds in your definite integral lol... You wouldn't you? http://en.wikipedia.org/wiki/Definite_integralBut you are right that the bounds of the interval of the integral (r to r-q) are wrong. You have to have bounds in terms of definitive values of x. Imho the right way would be to integrate from -1 to 1 if the circle has its center on 0 or from 0 to 2 if the center is at x=1. But i am really to lazy to do it right now I don't understand what you are trying to point out to me regarding what I said...
|
|
|
|