Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow integration of a function of a spline #47

Open
BeastyBlacksmith opened this issue Feb 18, 2018 · 2 comments
Open

allow integration of a function of a spline #47

BeastyBlacksmith opened this issue Feb 18, 2018 · 2 comments

Comments

@BeastyBlacksmith
Copy link

Would it be hard to allow for integration of a function of the spline?

For example

integrate( spl, a, b, (val) -> val^2 )

And then one integrates the square of the spline values.

@BeastyBlacksmith
Copy link
Author

another question to the same topic: integrate and derivative are not intended to be used with ParametricSplines do they?

@kbarbary
Copy link
Collaborator

kbarbary commented Feb 18, 2018

The underlying Fortran library doesn't allow for integrating an arbitrary function like integrate(spl, a, b, (x) -> x^2). But you could apply this function before creating the spline, like spl = Spline1D(x, y^2) rather than spl = Spline1D(x, y).

I think integrate and derivative on a ParametricSpline are the integral and derivative in each dimension, with respect to the curve parameter. So a curve through N dimensional space will have an integral that is a length N vector. Is that right @bshall?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants