Please somebody assist i have to make a programme in VB 6 to calculate area of any given shape using coordinates. Please assist
Calculating area
Collapse
X
-
-
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
-
Originally posted by smartchapYou 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 a rectangle = 2* length + 2* breadth ???!!!
Are you sure ?
MTBComment
-
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
-
Originally posted by RakoduIn 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.
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
-
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
-
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
Comment