Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 396089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:31:03+00:00 2026-05-12T16:31:03+00:00

I have a polyline that approximates a curve, and I want to draw it

  • 0

I have a polyline that approximates a curve, and I want to draw it as a smooth curve in PostScript, which supports Bezier curve drawing. To do that, I need to generate two control points between each pair of polyline points. (I can’t get the original curve from the source, just the polyline.)

I’ve had some success using cardinal splines from this description, but the parameters there are different from Wikipedia and GDIPlus.DrawCurve, both of which refer to tension. MS has no details, and Wikipedia has incomplete details (cardinal spline ignores x values?).

What are the formulas for the control points based on tension?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:31:04+00:00Added an answer on May 12, 2026 at 4:31 pm

    See this link http://www.ibiblio.org/e-notes/Splines/Cardinal.htm which provides simple formulas which can be used to calculate Bezier control points for a multi-segment smooth curve.

    The equations are really simple but for those who don’t want to repeat the calculations I’m providing my results:

    Let Pi (i=1..n) be the polyline points.

    First, learn how to calculate the derivatives on Pi:

    P1' = (P2 - P1) / a
    Pi' = (Pi+1 - Pi-1) / a (for i=2..n-1)
    Pn' = (Pn - Pn-1) / a 
    

    where “a” is a coeffecient (which probably means “tension” you mentioned), for instance a=2.

    Then, for each segment i (i=1..n-1) from Pi to Pi+1, Bezier control points B1i and B2i would be:

    B1i = Pi + Pi'/3
    B2i = Pi+1 - Pi+1'/3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List<Polyline> that I need to generate in a second thread so
I have a web app that will draw a polyline for each user (tracks
I have several GWT Maps API JavaScriptObjects (LatLng, Polyline) which I want to send
I've got a 2D closed polyline, which is reasonably smooth. The vertices that define
If I have a polyline that describes a road and I know the road
I have an application that gets the users location and draws a polyline on
I have a complex Region and a polyline which separates the region in two
OK, so I have a polygon that is represented as an encoded polyline. I'd
I have two coordinates for which I would like to draw a perpendicular line
I have the next code which show a path using a polyline. How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.