How to smoothly connect a number of points
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: How to smoothly connect a number of points

  1. #1
    Join Date
    Mar 2013
    Posts
    31

    How to smoothly connect a number of points

    Name:  points.png
Views: 99
Size:  4.2 KB

    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.

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    5,120

    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. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. This post is public domain as specified at https://creativecommons.org/publicdomain/zero/1.0/

    C, C++ Compiler: Microsoft VS2017

  3. #3
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


HTML5 Development Center