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

  • Home
  • SEARCH
  • 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 7810301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:43:23+00:00 2026-06-02T03:43:23+00:00

Given a line made up of several points, how do I make the line

  • 0

Given a line made up of several points, how do I make the line smoother/ curvier/ softer through adding intermediate points — while keeping the original points completely intact and unmoved?

To illustrate, I want to go from the above to the below in this illustration:

enter image description here

Note how in the above picture, if we start at the bottom there will be a sharper right turn. In the bottom image however, this sharp right turn is made a bit “softer” by adding an intermediate point which is positioned in the middle of the two points, and using averages of the angles of the other lines. (Differently put, imagine the lines a race car would drive, as it couldn’t abruptly change direction.) Note how, however, none of the original points was “touched”, I just added more points.

Thanks!! For what it’s worth, I’m implementing this using JavaScript and Canvas.

  • 1 1 Answer
  • 0 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-06-02T03:43:26+00:00Added an answer on June 2, 2026 at 3:43 am

    The following code found elsewhere here does the job for me, in the specific context of JavaScript-Canvas which I’m using — but please see Angus’ answer for a more general approach:

    var max = points.length;
    context.beginPath();
    var i = 0;
    context.moveTo(points[i].x, points[i].y);
    for (i = 1; i < max - 2; i++) {
        var xc = (points[i].x + points[i + 1].x) * .5;
        var yc = (points[i].y + points[i + 1].y) * .5;
        context.quadraticCurveTo(points[i].x, points[i].y, xc, yc);
    }
    context.quadraticCurveTo(points[max - 2].x, points[max - 2].y, points[max - 1].x,points[max - 1].y);
    context.closePath();
    context.stroke();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You are given a list of distances between various points on a single line.
Given two points in 3D space, A and B, I get a line segment
Given the line: Bitmap bitmap = new Bitmap(stream); where stream is a System.IO.Stream, are
Given the following line: [aaaa bbbb cccc dddd] [decimal](18, 0) NULL, How would you
Given the Ruby code line = first_name=mickey;last_name=mouse;country=usa record = Hash[*line.split(/=|;/)] I understand everything in
Using CMD line, in a given directory, I want to detect the most recently
Given I have a long phrase, say, in line :12 , as this example:
I need to draw a line one inch long on any device given a
I need to determine if a given selection is in between a start line
Given a bounding box, with definitions like bounds.min.(x/y/z) , bounds.max.(x/y/z) , and two points

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.