1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Formula to find volume of a rectangular solid

  1. Apr 1, 2015 #1
    Hi all,

    I need help finding a formula to find the volume of a solid that has a fixed width and depth but 4 different heights. To see what I mean, please take a look at a sketch I drew below.


  2. jcsd
  3. Apr 1, 2015 #2
    Since the top vertices aren't in the same plane, there is no obvious answer. It will likely depend on the shape of the top face.
  4. Apr 1, 2015 #3
    The top vertices has a rectangular shape and the dimension is 2x3. To clarify, the width of this solid is 2 and the the depth is 3. Meaning all angles on the top vertices are perpendicular to each other.
  5. Apr 1, 2015 #4
    You can get one of the corners of 2×3 face as origin of 3D coordinate and it's face(contain origin and 2×3) must be in x-y plate. Now you must find equation of face which is above of x-y plate (another 2×3 face) in form z=f(x,y) and calculate integral of f in 2 dimension x&y from 0<x<2 and 0<y<3. answer of integral will be volume of solid.
  6. Apr 1, 2015 #5
    By shape, I meant how the z-value of the top face changes wrt the domain bounded by the top face.
  7. Apr 1, 2015 #6
    All angles are perpendicular to each other with the exception of the lower vertices. If you cover the bottom of this solid, it would look exactly like a rectangular prism.

    Another way to put it is that if the height were all the same, eg.) 1.2, you could calculate the volume by multiplying 2 x 3 x 1.2
  8. Apr 1, 2015 #7


    Staff: Mentor

    One way to get the volume is to use the calculus technique of integration. To simplify matters I would turn the thing over so that the bottom is flat. Using the (now) top vertices, I would find the equation of the plane that represents the top face. Assuming that the plane of the top surface is defined by z = ax + by + c, the integral would look like this:
    $$\int_{x = 0}^2 \int_{y = 0}^3 ax + by + c~dy~dx$$
  9. Apr 1, 2015 #8
    I've attached an example image of what I mean. The model is the same as the one in your image. Notice the drastic change of color on the top face? That's because the quadrilateral polygon is made up of two triangles. If the polygon was planar, the triangles would be in the same plane and there'd be no change in color. Now I can also choose to retriangularize the polygon so the common edge of the triangles runs between the two other vertices. It would hence look differently and possibly have a different volume. So it's important to know the function z=f(x,y) that describes this top face since it's clearly not planar.

    Now I don't know what you mean by angles being perpendicular to each other. I've checked the angles for each pair of adjacent edges and if the edges are straight then no pair is at a right angle. Check it yourself by calculating the vectors for each edge and taking the dot product.

    Attached Files:

  10. Apr 1, 2015 #9
    Thanks but how do I find the equation of the plane that represents the top face?
  11. Apr 1, 2015 #10
    Wow, first off thank you for taking the time to write this response. I haven't really thought it out that far. Basically, what I'm trying to do is to estimate the volume of a pit excavation site by measuring all 4 sides of the pit. How do you suggest I find an estimation of the volume of this pit?
  12. Apr 1, 2015 #11
    It's a surface, but it's not a plane.

    For any two points in a plane defined by the equation [itex]a x + b y + c z + d = 0[/itex], the equation [itex]a \Delta x + b \Delta y + c\Delta z = 0[/itex] must apply, where [itex]\Delta x[/itex] represents the difference in x-coordinates and so on. This doesn't apply to the top face in question, since two opposite and parallel edges of equal lengths have different [itex]\Delta z[/itex].
  13. Apr 1, 2015 #12


    Staff: Mentor

    You have the coordinates of all four vertex points on the top face. Label these points A, B, C, and D (where A and C are opposite vertices, and B and D are opposite vertices).

    Form two vectors, ##\vec{AB}## and ##\vec{AD}##.
    Find the cross product of these vectors and call it ##\vec{n}##. This will be a vector that is perpendicular to (normal to) the plane of the top face.
    Take any of the four vertices, say ##A = (x_a, y_a, z_a)##.
    Let P(x, y, z) be any point on the top plane. Then the equation of the plane is given by: ##\vec{PA} \cdot \vec{n} = 0##.

    Edit: I've assumed that the top surface is a plane, but as da_nang points out, that might not be the case. The vertical sides of the box have to be specific lengths in order for the top surface to be planar.
  14. Apr 1, 2015 #13
    Well if you don't have any information on the interior then the best I think you can do without further information is to fit a plane to those coordinates and hope it doesn't vary too much from reality. Least-squares might do. After that, you use this approximation in the integral given by Mark44.
  15. Apr 1, 2015 #14
    If its not too much to ask, can you quickly do the calculation needed to find the volume of this solid so I can have something to refer to? Thanks!
  16. Apr 1, 2015 #15


    Staff: Mentor

    Why don't you give it a shot, and we'll take a look at what you did?
  17. Apr 1, 2015 #16


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    There's no explicit formula to calculate the volume of such a solid, and using integral calculus and a hefty dose of analytic geometry seems to be a bit much to figure the volume of a hole.

    A quick and dirty estimate of the volume can be made by calculating the areas of the ends of the excavation. These are trapezoids with a width of 2 units each. The heights indicated on your diagram are the lengths of the sides of each trapezoid:


    Let's call these areas A1 and A2. The volume can be calculated using the trapezoidal rule and will be:

    V ≈ (1/2) * Length * (A1 + A2) cubic units

    Here, Length = 3 units

    If you need something a little more accurate, you can calculate the area of a section of the excavation in the middle and use Simpson's First Rule, but the trapezoidal rule should give you a sufficiently accurate result for most purposes. :smile:
  18. Apr 1, 2015 #17
    Thank you, SteamKing! This is exactly what I needed. :biggrin:
  19. Apr 1, 2015 #18


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    If you take x going from 0 to 3, you could consider the cross-sectional area as a function of x. You have a common width of 2 and a variable height (varying linearly on each side). ##h_1## on the left, and ##h_2## on the right.

    ##A(x) = \frac{1}{2}(2)(h_1 + h_2) = h_1 + h_2##

    You could integrate this for x from 0 to 3, or (as it's linear) just take the averages of the h's and multiply by 3.

    This gives ##V = 3(1.35 + 1.35) = 8.1##

    Am I missing something?
  20. Apr 8, 2015 #19


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I thought it was worth posting the general solution here. If the solid has width ##w##, length ##l##, heights ##a, b## at the front corners and heights ##c, d## at the back, then:

    ##h(x, y) = a + \frac{y}{w}(b-a) + \frac{x}{l}[c + \frac{y}{w}(d - c) - (a + \frac{y}{w}(b-a))]##

    Where ##x## is the distance along the length and ##y## across the width and ##h(x,y)## is the height at that point.

    ##\int_{0}^{l} \int_{0}^{w}h(x, y)dydx = wl(\frac{a+b+c+d}{4})##

    So, the volume is ##wl## times the average height of the four corners, which makes sense.
    Last edited: Apr 8, 2015
  21. Apr 8, 2015 #20
    This is of course assuming the surface is a hyperbolic paraboloid, which is not necessarily the case. But it works as an approximation.

    An alternative approximation is to use two diagonally opposite points at heights [itex]z_1, z_2[/itex]. This allows you to calculate the volume as [itex]V = \frac{z_1 + z_2}{2} \Delta x \Delta y[/itex] by interpreting the surface as a plane.
    Last edited: Apr 8, 2015
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook