Simple Calculus problem: integrating over a line segment in 3D

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

Recommended Posts

I probably should know this, but somehow I can't be sure of the answer to this problem. Surely it will be considered trivial by some of you in this forum :) I have a function f(x,y,z) in 3D space - the domain is R^3, and it returns a value in R. I need to find out how to integrate this function over a line segment, defined by 2 points. If you can just help me with this, I'll deal with the rest myself (actually integrating the function I have), so don't worry about that! I just want some pointers on how someone would go about doing this integration with any function. My hypothetical solution might be terribly wrong, so I won't post it for now, just in case someone gives me a quick reply. Thanks in advance!

Share on other sites
I don't really know much about this stuff but I think you can represent your line as a parametric function and then express the value of the line in the 3d function as a composite function, and then integrate that. I think that would work but I really haven't done this stuff so...

Share on other sites
a and b are the points.

the line segment between a and b may be parametrized as s(t) = (1-t)a + tb, t in [0,1].

So, to integrate you must do:

I(f(s(t))*norm(ds/dt)*dt) = I(f(s(t))*norm(a-b)dt), from 0 to 1.

I is the integrate signal.

Share on other sites
read up on line integrals in a calculus book. are you solving this numarically?

Share on other sites
Your problem is sampling the curve in space. Google for "Integration by quadrature" and "Monte Carlo integration".

-cb

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• Forum Statistics

• Total Topics
634106
• Total Posts
3015548
×