Calculating area

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rakodu
    New Member
    • Oct 2008
    • 10

    Calculating area

    Please somebody assist i have to make a programme in VB 6 to calculate area of any given shape using coordinates. Please assist
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    can you post the code that you are working on, are you facing any problem with that ?

    Comment

    • Rakodu
      New Member
      • Oct 2008
      • 10

      #3
      Yes i facing a problem with starting it, its giving me a head ache

      Comment

      • tropix100
        New Member
        • Nov 2008
        • 12

        #4
        What is the area to calculate? Is it a squre, circle, cube, maybe the area of a bottle, the area of Texas?

        You need to supply a little more info.

        Comment

        • smartchap
          New Member
          • Dec 2007
          • 236

          #5
          You must know the formula(e) for the shape whose area is required to be calculated then input all the parameters required for area and place them in the formula. For example

          Area of square = (side)^4

          so input side and calculate area.

          Area of a rectangle = 2* length + 2* breadth

          Here input length & breadth and calculate area.

          You must know the shape first. Sometimes a shape is broken into several shapes to find out its area.

          If any other help is required please post what you have written and where you are stuck.

          Comment

          • MikeTheBike
            Recognized Expert Contributor
            • Jun 2007
            • 640

            #6
            Originally posted by smartchap
            You must know the formula(e) for the shape whose area is required to be calculated then input all the parameters required for area and place them in the formula. For example

            Area of square = (side)^4

            so input side and calculate area.

            Area of a rectangle = 2* length + 2* breadth

            Here input length & breadth and calculate area.

            You must know the shape first. Sometimes a shape is broken into several shapes to find out its area.

            If any other help is required please post what you have written and where you are stuck.
            Area of square = (side)^4 ???!!!


            Area of a rectangle = 2* length + 2* breadth ???!!!

            Are you sure ?


            MTB

            Comment

            • Rakodu
              New Member
              • Oct 2008
              • 10

              #7
              its area of any shape with coordinates, e,g calculating an area of X with coordinates (a,b), (c,d), (e,f), ..........

              Comment

              • tropix100
                New Member
                • Nov 2008
                • 12

                #8
                Area of a square is side A multiplied by side B
                The area of a rectangle is Long side A multiplied by Short side B

                Comment

                • Rakodu
                  New Member
                  • Oct 2008
                  • 10

                  #9
                  In the case of these coordinates the area is calculated as follows (a,b), (c,d), (e,f)
                  2*Area=((a*d)+( c*f))-((b*c)+(d*e))
                  This formula will work in every shape provided i know all coordinates not my situation is to do it in vb so that when i put any number of coordinates it should calculate area for me from those coordinates.

                  Comment

                  • tropix100
                    New Member
                    • Nov 2008
                    • 12

                    #10
                    Originally posted by Rakodu
                    In the case of these coordinates the area is calculated as follows (a,b), (c,d), (e,f)
                    2*Area=((a*d)+( c*f))-((b*c)+(d*e))
                    This formula will work in every shape provided i know all coordinates not my situation is to do it in vb so that when i put any number of coordinates it should calculate area for me from those coordinates.
                    Hmmm.....
                    To obtain the area of a particular shape is to use a formular that depends on that shape.

                    Co-ordinants are just a reference number to a datum point.

                    What is the shape you want to determine the area of? Is it a square? is it a rectangle? is it a circle?, an oval, a trapezium?, a hexagon?

                    Forget about the word co-ordinates and let me know what the shape of the area is that you are trying to evaluate is.

                    Comment

                    • Rakodu
                      New Member
                      • Oct 2008
                      • 10

                      #11
                      This formula works on any shape triangle, square, tripizium. I mean any

                      Comment

                      • smartchap
                        New Member
                        • Dec 2007
                        • 236

                        #12
                        First of all sorry for the wrong formulae typed by me. Actually I was in a hurry and by mistake typed wrong formulae. Thanks MTB for pointing them out. Correct formulae are:

                        Area of square = side^2 sq.units
                        Area of rectangle = Length * Breadth sq.units

                        Mr. Rakodu I think the formula posted by you is for calculating area of a triangle (I haven't checked it, it works for right angled triangle. For others I don't know). Because in your formula there are only 3 coordinates and trapezium, square, rectangle require four coordinates. However, You can do one thing. Divide the shape, whose area is to be calculated, into various triangles such that area of a triangle is not overlapped by other triangle and whole area is covered by all the triangles. So that
                        Area of the shape = sum of area of all the triangles (received by dividing)

                        Now with the help of your formula you can calculate the required area.

                        Comment

                        • tropix100
                          New Member
                          • Nov 2008
                          • 12

                          #13
                          To calculate the area of a square and of a rectangle multiply the width by the height.
                          Formula : L x H

                          To calculate the perimeter of a square or a rectangle
                          Formula : (2 x L) + (2 x H)

                          To calculate the area of a circle you need the radius, which is half the diameter. Once you know the radius
                          Formula : Pi x (R x R)

                          To calculate the perimeter of a circle
                          Formula : (R x 2) x Pi

                          To calculate the area of a triangle is to multiply the base by the height and divide it by 2.
                          Formula : (B x H)/2

                          To calculate the perimeter of a triangle
                          Formula : ((B x 2) + (H x 2))/2

                          To calculate the area of a hexagon can be a little complex but if you picture (or draw ) it as 6 seperate triangles, its not such a task.

                          As you can see by these examples that no 2 shapes are calculated in the same way.
                          If you have a 4 sided shape with 4 different length sides, then the formular gets a lot more complex.
                          If you have a part circle or an oval shape then it gets even more complex.

                          You cannot have one formular that will calculate the area of all shapes. It is geometrically impossible.

                          Comment

                          • Rakodu
                            New Member
                            • Oct 2008
                            • 10

                            #14
                            Thanks guys i will try to do it after that i will post it to you

                            Comment

                            Working...