Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. "Smoothing" out a PolyLine?

"Smoothing" out a PolyLine?

Scheduled Pinned Locked Moved WPF
data-structuresquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SledgeHammer01
    wrote on last edited by
    #1

    I normally Google for this kind of stuff, but I'm not sure of the proper name / terminology since I'm not really a math guy, so I'm not coming up with any hits... I'm trying to draw a very simple "graph". 0,0 10,10 20,3 30,15, etc. So, right now, I just add the points to a PolyLine and all is good. But this results in a sharp zig-zag line... how do I make it into a "smoother" "wave" type line based on the same point array? The only term I remember from math class is bezier curves lol, but that doesn't seem to be what I'm looking for.

    D 1 Reply Last reply
    0
    • S SledgeHammer01

      I normally Google for this kind of stuff, but I'm not sure of the proper name / terminology since I'm not really a math guy, so I'm not coming up with any hits... I'm trying to draw a very simple "graph". 0,0 10,10 20,3 30,15, etc. So, right now, I just add the points to a PolyLine and all is good. But this results in a sharp zig-zag line... how do I make it into a "smoother" "wave" type line based on the same point array? The only term I remember from math class is bezier curves lol, but that doesn't seem to be what I'm looking for.

      D Offline
      D Offline
      den2k88
      wrote on last edited by
      #2

      Try looking for Spline interpolation. Basically you're looking for a continuous function or a set of functions able to interpolate the points and retain continuity. So yes, splines are the way to go!

      S 1 Reply Last reply
      0
      • D den2k88

        Try looking for Spline interpolation. Basically you're looking for a continuous function or a set of functions able to interpolate the points and retain continuity. So yes, splines are the way to go!

        S Offline
        S Offline
        SledgeHammer01
        wrote on last edited by
        #3

        Seems like there are a bunch of different spline types. Am I looking for the cannonical spline?

        D 1 Reply Last reply
        0
        • S SledgeHammer01

          Seems like there are a bunch of different spline types. Am I looking for the cannonical spline?

          D Offline
          D Offline
          den2k88
          wrote on last edited by
          #4

          Cubic splines are a good balance between continuity and computation speed, but B-splines can be good too.

          S 1 Reply Last reply
          0
          • D den2k88

            Cubic splines are a good balance between continuity and computation speed, but B-splines can be good too.

            S Offline
            S Offline
            SledgeHammer01
            wrote on last edited by
            #5

            Hmm... I found some Petzold code that creates a canonical spline in WPF, seems like its working (doing what I want) unless I don't know what I'm talking about which is entirely possible since I don't know the diffs between all those splines haha. All I know is that it looks like a wave interpertation of my zig-zag line. Thanks!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups