[RESOLVED] Surface Area of a Hollow Cylinder
I have this so far
Code:
Dim cColumnHeightRound As Double = (40) / 1000
Dim n As Double = 3.142857142 '/ 1000
rRadius = (70) / 1000 '* 2
Dim mM2 As Double = 0
mM2 = (2 * n) * rRadius * cColumnHeightRound
'mM2 = mM2 / 1000
'mM2 = Math.Round(mM2, 3)
Me.txtTotalM2Round.Text = mM2.ToString
The result is 0.0175999999952 which is incorrect.
No matter what i try i can not get it to be 0.175 which is correct i believe.
regards
toe
edit
Code:
Dim cColumnHeightRound As Decimal = Decimal.Parse(Me.cmbColumnHeightRound.Text)
rRadius = Decimal.Parse(Me.txtRadius.Text)
Dim mM2 As Decimal = 0
mM2 = CDec((2 * Math.PI) * rRadius * cColumnHeightRound)
mM2 = Math.Round(mM2, 3)
mM2 = mM2 / 1000
mM2 = Math.Round(mM2, 3)
Me.txtTotalM2Round.Text = mM2.ToString
seems to be ok :blush::blush::blush::blush::blush::blush::blush::blush
help, after a closer look its incorrect
Re: Surface Area of a Hollow Cylinder
What's wrong with the second one when you run it? For calibration, for a cylinder of radius 70 units, height 40 units, the surface area of the cylindrical part is 2*pi*70*40 = 17592.91886 units^2. I don't really want to puzzle through your unit conversions to figure out what corresponds to what, but that will only move the decimal place around anyway.
Re: Surface Area of a Hollow Cylinder
The second one returns 17.593 when i am trying to get 0.17593.
I have tried rounding and /1000 and i just cant seem to get the correct answer.
ps: i am working in millimeters just in case that pertains to anything
70mm and 40mm i even tried working in meters 0.07 and 0.04
regards
toe
Re: Surface Area of a Hollow Cylinder
This seems to be working good enough
Code:
'http://www.calculatorfreeonline.com/calculators/cylinder.php?action=solve&last=rh&given_data=rh&r=.04&h=.07&units_length=meters&v=0.78539816339745&a=3.1415926535898
Dim cColumnHeightRound As Double = Double.Parse(Me.cmbColumnHeightRound.Text)
rRadius = Double.Parse(Me.txtRadius.Text)
Dim mM2 As Double = 2 * Math.PI * rRadius * cColumnHeightRound
mM2 = Math.Round(mM2, 0)
mM2 = mM2 / 1000
mM2 = mM2 / 1000
mM2 = Math.Round(mM2, 3)
Me.txtTotalM2Round.Text = mM2.ToString
Re: Surface Area of a Hollow Cylinder
What you've written would take measurements in millimeters and spit out measurements in square meters, which is apparently what you wanted (though you didn't say it). I'm not quite sure why you keep writing 0.17593; it's 0.017593 m^2, using my own calculation and the calculatorfreeonline.com calculator. Perhaps it's just a recurring typo.
Re: Surface Area of a Hollow Cylinder
Quote:
Originally Posted by
jemidiah
What you've written would take measurements in millimeters and spit out measurements in square meters, which is apparently what you wanted (though you didn't say it). I'm not quite sure why you keep writing 0.17593; it's 0.017593 m^2, using my own calculation and the calculatorfreeonline.com calculator. Perhaps it's just a recurring typo.
Its not a typo its my brain or lack of
All good now thanks