Jump to content
  • Advertisement
Sign in to follow this  
Tree Penguin

Volume of a parabole function with 3 axis? (4-dimensional volume)

This topic is 3323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to figure out the formula for calculating the volume of part of a 3-axis parabole, with different lengths on each axis, but starting on (0,0,0). My maths isn't that strong (especially terminology), so I have no idea what to google for, and please forgive me if I'm sounding like a noob, because I am ;). Anyway, what I have been able to figure out are the calculations for the volume of the parabole when I use the same maximum value (m) for each axis: 1 axis: (m*m)/3 * m 2 axes: (m*m)/3 * m * (2*m) 3 axes: (m*m)/3 * m * (2*m) * (1.5*m) or simply m^5... Any ideas on how to make different maximum values for x, y and z possible? By the way: the formula for the parabole is simply x*x, (x*x+y*y), (x*x+y*y+z*z). An example of what I'd like to do: The volume of the graph (4-dimensional) in range (0,0,0) to (12,7,31) where w = (x*x+y*y+z*z). Brute-forcing this answer seems to give a value somewhere above 1,000,000. Thanks! [Edited by - Tree Penguin on August 14, 2009 6:33:19 AM]

Share this post


Link to post
Share on other sites
Advertisement
Right, I had a collegue of mine crack this down, and he did it :] . The code is below for anyone who might need it for any reason.


inline float fabc(float a, float b, float c)
{
return (a*a*a * b * c + a * b*b*b * c + a * b * c*c*c)/3.0f;
}

float fXXYYZZ(float x1, float x2, float y1, float y2, float z1, float z2)
{
return ((fabc(x2,y2,z2) - fabc(x1,y2,z2)) - (fabc(x2,y1,z2) - fabc(x1,y1,z2))) -
((fabc(x2,y2,z1) - fabc(x1,y2,z1)) - (fabc(x2,y1,z1) - fabc(x1,y1,z1)));
}




Where (x1, y1, z1) to (x2, y2, z2) is a box in the 3d coordinate space of the graph.

EDIT: forgot some parenthesis.

[Edited by - Tree Penguin on August 14, 2009 10:43:53 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!