Jump to content
• Advertisement

# Lagrange Interpolation question

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

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hi, In this: http://www.cut-the-knot.org/Curriculum/Calculus/LagrangeInterpolation.shtml When I drag one dot to the same place as another, the line disappears, it seems Lagrange doesn't like to have two same point (x,y) values as control points. Is there an alternative to Lagrange interpolation that does accept two (or more) same point (x,y) control points without having the "line disappear" (so to speak). Thanks.

#### Share this post

##### Share on other sites
Advertisement
Maybe I'm missing something, but can't you just skip that control point and reduce the polynomial degree by one?

#### Share this post

##### Share on other sites
sorry, but assuming you can't skip a control point, such that a sample is:

(8, 5) (8, 5) (2, 3) (6, 4)

the first two control points are the same, Lagrange would fail with this control point. is there an alternative interpolation method that would say that it's ok for some points to have the same value?

thanks!

#### Share this post

##### Share on other sites
Just thin out repeated points and then proceed as normal.

The sentence above is a method that satisfies your needs.

#### Share this post

##### Share on other sites
Quote:
 Original post by helloworld123is there an alternative interpolation method that would say that it's ok for some points to have the same value?
Think about what you are asking for a moment: you want a curve that smoothly passes through each point, but you want two adjacent points to be in the same location.

Take a piece of paper, and try to draw such a curve - you will see that either you have to ignore the duplicate (alvaro's solution), or you have to draw a loop where the duplicate vertices lie. Unfortunately, there are infinitely many such loops that can be drawn while maintaining a smooth curve, and there isn't a clear criteria to pick just one.

#### Share this post

##### Share on other sites

hi,

yes sorry, it seems removing similar control points would be better.

here's a different question:

given these set of unique control points:

(8, 5) (2, 3) (6, 4) (9, 10) (12, 5)

-> if i use it in lagrange, and plug 8, i'll get 5, and so on right.

-> now assuming i have _only_ these X values of control points (8, 2, 6, 9, 12), would i still get the corresponding Y using lagrange?

i mean, what do i have to have, aside from only these X values to get the Y values (assuming you don't want to keep the Y values)? it'll be like i only have:

- X values from control points
- something else that can be used in lagrange to get those Y values w/the X values from control points

i am sorry if question is not too clear, my english is not the native language. thanks!

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
17
5. 5
• Advertisement

• 12
• 14
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
631756
• Total Posts
3002117
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!