Skip to content

In the catmull_rom method, how is the max_parameter() defined? #211

@xarthurx

Description

@xarthurx

I'm testing the newly added interpolation function catmull_rom where I'm a little confused by the max_parameter() of a spline.

For a simple case that to interpolate 11 points Vector2d(x, x) where x = 0 - 10.
Then I tested the intepolated catmull_rom crv:

    for (size_t i = 0; i <= 11; i++) {
      cout << "input: " << i << " output: " << cr(i).transpose() << endl;
    }
    cout << "max pram: " << cr.max_parameter() << endl;

the output is:

input: 0 output: 0 0
input: 1 output: 0.81961 0.81961
input: 2 output: 1.68179 1.68179
input: 3 output: 2.52269 2.52269
input: 4 output: 3.36359 3.36359
input: 5 output: 4.20448 4.20448
input: 6 output: 5.04538 5.04538
input: 7 output: 5.88627 5.88627
input: 8 output: 6.72717 6.72717
input: 9 output: 7.56807 7.56807
input: 10 output: 8.40896 8.40896
input: 11 output: 9.29669 9.29669
max pram: 11.8921

The result is quite strange to me...

Is the parameter param of cr(param) supposed to be the length on the spline?
If will it be possible to add a normalised function so that the parameter range is [0, 1]?

Currently, I don't understand how to get the value of an interpolated point on the spline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions