Results 1 to 9 of 9

Thread: Defining a volume, and checking if a co-ordinate is within that volume

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    Defining a volume, and checking if a co-ordinate is within that volume

    Hi there

    I've posted this in the calculus section as I think that's where most of the work to solve this is gonna be!

    Basically, my problem is as follows. I have a path along which a cross sectional area is swept along, hence giving me a volume. I need some help in establishing the limits of this volume, so I can check whether a point lies within them. the path is defined by beziers cubic interpolation between about 10 points. once i have the volume definition, i think i can using triple integrals to check if the point is in the volume, which will work, however i need to be able to define the volume limits before i can do this.

    the link shows a screenshot of what i'm doing - i want to find if the centres of the little cubes lie within the blue volume.

    http://www.facebook.com/album.php?ai...f5&id=61408485

    i was thinking, take given point x, differentiate the equation of the blue bit (that's just an example that used the bezier interpolation, i'm just gonna stick to y=x^2 for now :P), so find tangent, then can find normal to that, which will give me the plane that the cross-section will lie on. knowing, for that value x, what area y and z may be in, then use a double integral (using limits of the cross-section, i'm using z^2+y^2=1, arbitrary circle), see if the point is inside.

    doing that, i'm only taking into account the line path varying in x and y, with constant z, but that's suitable for this task. however, i realised that even when the normal to the tangent is found, that only gives me the line on which the cross-section lies, and all 3 co-ordinates change still across this area

    as for after the volume is defined, the point checking part might go like this ...

    S = integration sign
    (x1)S(x2) = integrations with limits
    >/ = greater than or equal to
    V = volume
    d= differential

    SSSxzdV where V is bound by x,y,z

    For example let x = 0, y = 0, y = 6, z = x^2. z = 4. for
    x >/ 0, y >/ 0, z >/ 0

    Change the limits
    z = x^2....4. Therefore x = 0...2, y = 0...6

    therefore SSSx.z.dV = (0)S(2).(0)S(6).(x^2)S(4) x.z.dz.dy.dx

    Integrate with respect to dz
    = (0)S(2).(0)S(6).[(x.z/2)](x^2)...(4).dy.dx.
    Integrate with respect to dy
    =(1/2).{(0)S(2).(0)S(6).[(16x -x^5).y](0)...(6). dx
    Integrate with respect to dx
    = 3[8x^2 - (x^6/6)](0)...(2)
    = 3.2^5 (1 - (1/3))
    =2^6
    = 64

    do people have any suggestions on both parts? (the volume definition, and the co-ordinate check)

    I'm really struggling with this, and it's beginning to drive me nuts!

    Thanks,
    Emily

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

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    Sorry, I couldn't access the image you posted (I never check my Facebook account but actually did log in to see if that would help, which it didn't).

    The mental picture I'm using is of an arbitrarily-shaped loop being pulled through space at a constant orientation, where points in the center are following a path you've defined through the Bezier interpolation you talked about. Your problems: defining limits to integrate over, and checking if points are in the volume defined by the process above.

    I don't actually think defining limits to integrate over help much here. In this case, where the loop's orientation doesn't change, finding the volume should be as simple as finding the area of the loop and multiplying that by the length of the line (which can be determined through a line integral given that you've defined your curve algebraically). Determining whether a point is in the volume or not could be done by doing a change of axes that makes your loop oriented along a single axis as it moves. You could then much more easily get a cross-section of this volume with the coordinates of the point to be checked being the coordinates that are not along the axis the loop is oriented along (picture this and it becomes clear). From there you would be able to check whether or not the point is inside of your loop (note that the loop may have moved around from its original position, due to the path that it's been taking through space; you'd have to account for that when checking if the point is in the loop at this particular place in its path).


    The situation seems to become much, much worse if you allow an arbitrary path and orientation of your loop--if the loop faces the direction of your Bezier curve at every point it might be tractable, but it's too late to think about that now, particularly if I haven't got the setup right.

    Hope this helps. Please clear up any confusion I have about this problem, and I'd be happy to revise my answer.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    http://photos-e.ak.facebook.com/phot...79180_5495.jpg

    I tried the link again, tink the middle got lost last time.

    Not too sure that what you are saying is totally applicable, as the direction of the cross-section follows the curve. i.e. the normal to the surface is aligned with the tangent of the curve at all points.

    forgive me if i've got it wrong and that is what you mean. i'm working on an example now to clarify your method to myself. just to check - what you are saying, is that if i have algebraic definitions of my cross-section area, and my line equation, i should just be able to multiply the two?

    i think i'll deal with the volume definition first before approaching the co-ordinate position. Crossing bridges and all.

    Thanks for your help!
    Emily

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    right, i've had a chance to have a think ...

    it seems like what you are saying is that it's ok if the loop is always aligned, say, parallel with the y plane, or such like, then for any given point on the sweep line, all i have to do is find the new loop position, and check ...

    well unfortunately, the alignment of the loop is not constant, like i mentioned previously, it's orientation is always normal to the tangent of the sweep line.

    i think i'm back to square one again

    taking the line integral and multiplying by the surface integral doesn't really help me either, as it gives me a way to calculate the volume, but i really need a proper expression for the volume, not just a number.

    thanks!

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

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    Hmm... I was afraid it might be as you said, with the orientation changing (sad). I'm not quite sure what you mean about finding the volume by multiplying a line and surface integral, but that doesn't seem to matter much for your application. It sounds like you're really interested in checking whether a point is within your volume, and you would really like some form of explicit limits of integration which could be used to check whether the point is in there.

    Intuitively, I just don't see how you could define standard limits to integrate over. In Cartesian, for example, you would need a couple of ridiculous functions which give the top and bottom heights of the shape, and then the limits of integration would still be a bit saddening since you'd have to project the shape onto the x-y plane. Also, if the volume bent back on itself so that it had multiple tiers of z heights, you couldn't even use Cartesian in the first place. Perhaps if you did a crazy coordinate transfer it could work, but I don't really know enough about that.

    Still... I don't think it should be too horrendous to check if a point is in the volume. All you would need to do is apply the condition that the vector connecting the point p to any point x on the line must be orthogonal to the tangent of the curve at x (that is, the line connecting these two must lie in the plane that the loop was swept in as it went along the point x in your Bezier curve). Since you should have some cubic expression for the path, applying this condition should be doable algebraically. I think you'd end up with a slightly nonlinear system of equations, but it shouldn't be awful.

    You might get several x points on the curve that satisfy this condition. For each, you could check whether or not that point when viewed in the plane of the loop which passes through that point is inside the loop (which would be a bit ugly, but doable given an expression for the loop). That would be all I could formalize this more I think, but the basic ideas are as above.



    Yes? No? On the right track?
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    hmm ...

    so what you are saying, is that all i have to do is check the vector is orthogonal to the tangent at SOME/ANY point along the path?

    i'm either confused, or don't think that'll work ... imagine a cuboid (a square extruded along a straight path y=2 for example) embedded inside a larger cuboid, the first cuboid being like the one i'm finding the volume of. if a point p sits at the top of that volume, drawing a line to every x point on the curve y=2 will never give me a line that is orthogonal to y=2.

    possibly i'm confused?

    Thanks,
    Emily

  7. #7
    New Member
    Join Date
    Apr 2008
    Posts
    14

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    If you won't the area of that Volume of that shape, get the area of the end using Integration (I think this was the place to go for areas under a curve), then multiply by the length. The fact it's irregular is too confusing for me. Could you not estimate the volume by counting the number of cubic units (little cubes) inside it. What is it anyway? It looks like a blue tongue. Give it a licking. Wooo-yeah.

    Oh forget it. Buy an A-Level Maths book. It'll be in there somewhere. Could you not make it a cuboid. Strain your eyes a little, turn it askew or something.

    This might help : (How to find the area under a curve) http://66.102.9.104/search?q=cache:t...lnk&cd=9&gl=uk

    Or divide into very small strips, and just add the areas of the strips, which is what integration is I think.

    Here's a guide to the area of the end of your blue tongue shape :

    http://science.jrank.org/pages/3618/Integral.html

    In full :

    Other Free Encyclopedias :: Science Encyclopedia :: Science Encyclopedia Vol 3
    Integral - Definite Integrals, Indefinite Integrals - Applications
    The integral is one of two main concepts embodied in the branch of mathematics known as calculus, and it corresponds to the area under the graph of a function. The area under a curve is approximated by a series of rectangles. As the number of these rectangles approaches infinity, the approximation approaches a limiting value, called the value of the integral. In this sense, the integral gives meaning to the concept of area, since it provides a means of determining the areas of those irregular figures whose areas cannot be calculated in any other way (such as by multiple applications of simple geometric formulas). When an integral represents an area, it is called a definite integral, because it has a definite numerical value.

    The integral is also the inverse of the other main concept of calculus, the derivative, and thus provides a way of identifying functional relationships when only a rate of change is known. When an integral represents a function whose derivative is known, it is called an indefinite integral and is a function, not a number. Fermat, the great French mathematician, was probably the first to calculate areas by using the method of integration.



    Applications
    There are many applications in business, economics and the sciences, including all aspects of engineering, where the integral is of great practical importance. Finding the areas of irregular shapes, the volumes of solids of revolution, and the lengths of irregular shaped curves are important applications. In addition, integrals find application in the calculation of energy consumption, power usage, refrigeration requirements and innumerable other applications.



    Resources
    Books
    Abbot, P., and M.E. Wardle. Teach Yourself Calculus. Lincolnwood, IL: NTC Publishing, 1992.

    Larson, Ron. Calculus With Analytic Geometry. Boston: Houghton Mifflin College, 2002.

    Weisstein, Eric W. The CRC Concise Encyclopedia of Mathematics. New York: CRC Press, 1998.



    J.R. Maddocks

    KEY TERMS
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Fundamental Theorem of Calculus
    —The Fundamental Theorem of Calculus states that the derivative and integral are related to each other in inverse fashion. That is, the derivative of the integral of a function returns the original function, and vice versa.

    Limit
    —A limit is a value that a sequence or function tends toward. When the sum of an infinite number of terms has a limit, it means that it has a finite value.

    Rate
    —A rate is a comparison of the change in one quantity with the simultaneous change in another, where the comparison is made in the form of a ratio.

    If you don't find this useful, or too simple, it might be useful to people who found that stuff in post one complete gobble-de-gook.
    Last edited by SirBillGatesJnr; Apr 24th, 2008 at 11:39 AM.

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    bill,

    using triple integrals to find the volume is a good way if that's what you want to do - find the volume, as a numerical answer, with specified integral limits. equally, counting the number of cubes inside would work. in a way, i'm trying to do exactly that - find the cubes which are more than half inside the blue "tongue".

    but i'm trying to find a way of doing this without manually selecting them, which, as well as tedious, is also inaccurate. there's no chance of changing it to a nicer shape unfortunately. so i need to be able to identify if the centre of one of those cubes is inside the blue tongue. it sounds so simple, but at the moment it looks anything but ...

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

    Re: Defining a volume, and checking if a co-ordinate is within that volume

    In your example with the cuboid, let's say the curve goes along the line defined by y=2, x=0 [recall that y=2 defines a plane; you need another equation to restrict that down to a line]. Given a point, say, (5, 15, 2), find a point on the line which must be of the form (0, 2, z) for any z such that the tangent to the line at (0, 2, z) is orthogonal to the line connecting (0, 2, z) and (5, 15, 2). All tangents to this particular line are (0, 0, 1), since the line is increasing along the z axis.

    Then we have the condition that D = (5, 15, 2) - (0, 2, z) = (5, 13, 2-z) is perpendicular to T = (0, 0, 1). When does this happen? When D dot T = 0, or

    (5, 13, 2-z)*(0, 0, 1) = 5*0+13*0+(2-z)*1 = 2-z = 0 -> z = 2.

    Thus we check the point (0, 2, 2) assuming my algebra is miraculously good at 4am.


    Let's say that the square which is swept along the z axis is actually a circle of radius 4, with the center of the circle at (0, 2, z) as it moves along the path. Then the distance between (5, 15, 2) and (0, 2, 2) [about 14] is the radius between the cross section's center and the point in question. Since 14 > 4, we must be outside of the circular cross section, meaning this point must be outside of the volume.

    Note that this assumes the loop is actually swept through (0, 2, 2) [in fact, I checked all z]. If I were better at drawing I'd make a picture, but I do think this method works.

    I'd be happy to clear up any confusion as it arises.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

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