d = 50 cm (diameter of circle)

L = 120 cm (length of cylinder)

h = 10 cm (height of circular segment)

The Figure to the left is sideview of the cylinder, and the figure to the right is front view.

first part is easy.

Find out how much liquid is in the cylinder

Code:

`A=r^2/2 * ((pi*v)/180 - sin(v))`

A=312,5*(1,854587-0,96)=279,5581 cm^2

V_(cylinder) = 279,5581 cm^2 * 120 cm = 33546,97 cm^3

V_(cylinder) = (33546,97 cm^3)/(1000 cm^3/L) = 33,54697 L

i need to find the new height of the circular segment, if i add 50 L liquid. so our new V_(cylinder) is 50 + 33,54697 = 83,54697 L.

how would i go about doing this? i can't exactly isolate V from the previous formula?

If the value was 5 then I'd fill 5% of the ProgressBar. However this is not always the case as the Min/Max are properties(doubles) and the minimum could be... say -57 and the maximum could be... say -3. How would I find out what percentage to fill the ProgressBar?

Why did I ever curse out my 8th grade algebra teacher telling her I'd never use this crap?!!!

Edit: Ok, so I think I may have figured it out. Could somebody confirm it for me?

Take the maximum and subtract it from the minimum. I'll call this x

Take the value and subtract it from the minimum. I'll call this y

Divide y into x to get the percentage.

Using this with Min: -57 and Max: -3 and Value: -10, I'd do this:

-57 - -3 = 54

-10 - -3 = 47

47 / 54 = 0.87 or 87%

Edit #2: Then to figure out the amount needed to fill the control then I'd take the percentage above and multiply it by the control's width:

Code:

`Private Function GetPercentage() As Double`

Dim x As Double = max - min

Dim y As Double = pValue - min

Return y / x

End Function

Private Function GetFillWidth() As Double

Return Me.GetPercentage * Me.Width

End Function