Skip to content

Interpolation function coefficients  #1

Open
@tanajikamble13

Description

@tanajikamble13

Hi,
Thanks for sharing the work. I want to fit curved line through given points. I am unable to understand how you chose the coefficient for interpolation function e.g. for CatmullRom you use the following function

interpolate(double u, const Vector& P0, const Vector& P1, const Vector& P2, const Vector& P3)
{
	Vector point;
	point=u*u*u*((-1) * P0 + 3 * P1 - 3 * P2 + P3) / 2;
	point+=u*u*(2*P0 - 5 * P1+ 4 * P2 - P3) / 2;
	point+=u*((-1) * P0 + P2) / 2;
	point+=P1;

	return point;
}

Can I use more than four control points ? I tried with more than four point but algorithm considering only 4 control points. Please help me, I am waiting for you reply.
Thanks in advance !!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions