-
February 20th, 2014, 03:16 PM
#1
How to smoothly connect a number of points
Hello every body,
I have attached a picture of a number of points. I need to connect the points smoothly, there should not be any sharp corners. Could any one tell me how that can be done?
Thanks in advance.
-
February 20th, 2014, 03:39 PM
#2
Re: How to smoothly connect a number of points
One way would be to use LeGrange interpolation to create a smooth curve that passes through the points. See
http://web.cs.wpi.edu/~matt/courses/...ks/curves.html
http://en.wikipedia.org/wiki/Lagrange_polynomial
There are also several sites offering c/c++ implementations. See
https://www.google.co.uk/search?q=la...EOWI0AX1zoDYAw
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
February 21st, 2014, 08:02 AM
#3
Re: How to smoothly connect a number of points
for the above a "simple" interpolation like Lagrange will work.
there are other techniques that will work for less obvious sets of points. Such as bezier curves. (which is not the same as a bezier spline). Bezier typically needs additional parameters to define how "tight" the path needs to. (this is something Lagrange doesn't need, but it has deficiencies elsewhere).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|