Results 1 to 6 of 6

Thread: [RESOLVED] Surface Area of a Hollow Cylinder

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Resolved [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

    help, after a closer look its incorrect
    Last edited by toecutter; Dec 16th, 2009 at 12:52 AM. Reason: fixed

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    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.
    Last edited by jemidiah; Dec 16th, 2009 at 03:41 AM.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    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

  4. #4

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    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

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    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.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  6. #6

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: Surface Area of a Hollow Cylinder

    Quote Originally Posted by jemidiah View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width