HOW MUCH DOES IT HOLD |

HOW MUCH DOES IT HOLD?

I am fortunate to have learned a little Visual Basic. This has allowed me to make a number of small applications to help primarily with mathematical calculations that I commonly perform. Most of these are for work purposes and serve to help me make calculations on the spot where conditions may not be suitable for a paper, pen and calculator.

One such place is on top of large water storage reservoirs, where I frequently find myself at work. I decided that it would be helpful to calculated the volume of a reservoir on which I was working. That is, how many cubic meters of water does it contain when full. Typically you would need the radius or diameter of the round top of the reservoir to calculated the volume. It is not always possible to measure this due to the size of the structure or obstructions preventing a simple measurement across the surface.

The problem then was how to find the diameter of the reservoir without measuring it straight across the top. In so doing, it soon became clear to me that I was going to need a little high school trigonometry and basic geometry. My trig ,however, had grown a little rusty in the last 20 years.

But before I could give myself a refresher in trig I first needed to figure out, in principle, how I was going to calculate the diameter with the information that I had available to me. After much pondering I realised that the answer to finding the diameter of a circle lay, strangely enough, in the geometry of triangles!

The first question was what values are available for me to measure while on the top of the reservoir. This is the principle I devised.

I decided to measure a "Long line" across a small section of the reservoir, as in the diagram to the left. In addition, I measured a "Short line" from the centre of the first line to the wall of the reservoir at 90 degrees - as per the diagram.

Now consider the relationship between these two lines. If we were to make the diameter of the reservoir larger, the long line would become longer while the short line stayed the same. Conversely, if you reduce the diameter then the long line will get shorter in relation to the short line. This relationship between the long and the short lines would allow me to calculate the diameter of the reservoir using only the lengths of the long and short lines. After that the calculations for the surface area and then the volume would be simple.

__ The trick now was to figure out how to calculate the diameter using only the lengths of the long and short lines.__

The following steps show how I made this calculation.

CALCULATION |

We know the length of line "a" as it is half the length of the long line which we have measured.

We also know the length of line "b" as this is the short line which we have measured.

Now draw a line from the point where line "a" touches the circles circumference to the point where line "b" touches the circle. Lets call this line "c".

Knowing the lengths of line "a" and line "b" as well as the fact that the angle where they meet is 90 degrees, we can use the theory of Pythagoras to calculate the length of line "c".

The formula is :- ** a2 + b2 = c2**

Now draw 2 tangents to the circle - T1 and T2 - where T1 intersects the circle at the point where line "a" touches it and T2 intersects the circle at the point where line "b" touches it.

Extend line "b" through the circle ( which makes the diameter, the length we eventually want to ascertain ).

Draw a line from tangent T1 to the point where it intersects the centre line.

Call this line "d". This will be a radius of the circle.

Now the Trig begins.

We know lengths "a", "b" & "c" as well as angle "A" (90 Deg).

What we need is the value of angle "B".

We now use Trig to calculate the value of angle C.

The formula is :- **tanC = b / a**

For those using a sharp scientific calculator, the keys are as follows :

** b / a = INV tan**

Now the fact that the angles of a triangle always add up to 180 Deg allows us to calculate angle "B" using the formula :

**B = ( 180 - ( A + C ))**

We now know the value of angle "B" and the length of line "c".

So lets look at the next triangle.

The new triangle makes use of angle "B" and line "c" from the previous triangle. Note that we are no longer working with a 90 Deg triangle.

Now due to the fact that that line "d" and line "e" are both radii of the circle, the triangle will be isosceles. This means that angle "D" will be equal to angle "B".

As in step 3 the angles of a triangle add up to 180 Deg allows us to calculate angle "E" using the formula :

** E = ( 180 - ( B + D ))**

We now know line "c" and angle "B" and "E".

What we now need is the length of line "e".

So back to Trig.

We use the formula :- **e = c sin(D) / sin(E)**

We now have the length of line "e" which is the radius of the circle.

Lengths "f" and "g" are radii of the circle. When added together they give us the diameter.

What we now want is the area of the circle. To get this we use the simple formula :- ** **Area** = pr2 **Where **p **= 22 / 7** **

Just for interest, if we wanted to calculate the circumference of the circle we would use the formula :- c = pd = 2 pr

The last thing we need to give us the volume is the height of the reservoir.

The formula for volume is as follows :-

Volume = area x height

Where area = pr2

Well done if you have followed this far. We now have the volume of the reservoir.

Take care to watch your units when doing the calculations. Meters to millimeters. Litres to Cubes. And so on.

The formula for Litres to Cubes is :- C = litres / 1000

SOFTWARE |

To save you the trouble of doing all those calculations, should this information be of practical use to you, I have made my application available for downloading.

If you have read and understood the 6 steps above, then the correct use of the app should be simple to understand.

For those who do Visual Basic programming, I have included the source code below.

Remember that visual basic does not do its calculations in Degrees, but Radians.

You may therefore need to do conversions while programming.

To Convert Degrees to Radians :- * p / 180

To Convert Radians to Degrees :- * 180 / p

Dim Volume As Variant

Dim High As Variant

Dim Circumf As Variant

Dim Area As Variant

Dim LLine As Variant

Dim SLine As Variant

Dim LH As Double

Dim LR As Variant

Dim A1 As Double

Dim A2 As Double

Dim A3 As Double

Dim A3Temp As Double

Diameter = (Val(TextD.Text))

VolCalculation

End Sub

Private Sub TextH_Change()

High = (Val(TextH.Text))

VolCalculation

End Sub

Public Sub VolCalculation()

If Diameter > 0 And TextD.Text <> "" Then

Circumf = (Int(Diameter * 2200 / 7)) / 100

Area = (Int((Diameter / 2) * (Diameter / 2) * 2200 / 7)) / 100

End If

If Diameter > 0 And Height > 0 And TextD.Text <> "" And TextH.Text <> "" Then

Volume = Area * High / 1000

End If

TextCir.Text = Circumf

TextA.Text = Area

TextV.Text = Volume

End Sub

Private Sub TextLL_Change()

LLine = (Val(TextLL.Text)) / 2

DiaCalculation

End Sub

Public Sub DiaCalculation()

If TextLL.Text <> "" And LLine > 0 And TextSL.Text <> "" AndSLine > 0 Then

LH = Sqr((LLine * LLine) + (SLine * SLine))

A1 = Atn(SLine / LLine) * (180 / (22 / 7))

A2 = 180 - (90 + A1)

A1 = A2 * (22 / 7) / 180

A3Temp = 180 - (2 * A2)

A3 = A3Temp * (22 / 7) / 180

LR = ((LH * Math.Sin(A1)) / (Math.Sin(A3))) * 2

LR = Int(LR)

LR = LR / 1000

TextD.Text = LR

End If

End Sub

Private Sub TextSL_Change()

SLine = (Val(TextSL.Text))

DiaCalculation

End Sub