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 3311414
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:52:26+00:00 2026-05-17T21:52:26+00:00

I posted a previous question about generating a bezier curve based on only the

  • 0

I posted a previous question about generating a bezier curve based on only the start and end points, and I was able thanks to the answers in that create a bezier curve using the information I have.

This is the code that allows me to draw the types of curve that I want on a form.

private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
    Random rnd = new Random();
    Point startp = new Point(rnd.Next(0, this.Width), rnd.Next(0, this.Height));
    Point endp = new Point(rnd.Next(0, this.Width), rnd.Next(0, this.Height));
    int xMod = 0;
    int yMod = 0;
    if (startp.X > endp.X) {
        xMod = -1;
    } else {
        xMod = 1;
    }
    if (startp.Y > endp.Y) {
        yMod = 1;
    } else {
        yMod = -1;
    }
    Point control1p = new Point(endp.X + (rnd.Next(20, 50) * xMod), endp.Y + (rnd.Next(20, 50) * yMod));
    Point control2p = new Point(endp.X + (rnd.Next(5, 20) * xMod), endp.Y + (rnd.Next(5, 20) * yMod));
    Point[] pts = {
        startp,
        control1p,
        control2p,
        endp
    };
    Pen dashed_pen = new Pen(Color.Black, 0);
    dashed_pen.DashStyle = Drawing2D.DashStyle.Dash;
    for (int i = 0; i <= 2; i++) {
        e.Graphics.DrawLine(dashed_pen, pts(i), pts(i + 1));
    }
    e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality;
    Pen bez_pen = new Pen(Color.Black, 3);
    e.Graphics.DrawBezier(bez_pen, pts(0), pts(1), pts(2), pts(3))
}

Is there a way, or can someone help me with returning all the points that form the curve? I’d like for each point of a curve calculated from those points to be returned in an array of points, but I’m having no luck figuring it out, and haven’t been able to find a similar solution on stackoverflow or google in general.

Thanks.

  • 1 1 Answer
  • 1 View
  • 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-17T21:52:27+00:00Added an answer on May 17, 2026 at 9:52 pm

    What you want to do is to convert a Bezier Curve (Cubic from the looks of it) into a Polyline

    Use the Equation on this page…Value of t should be between 0 to 1…Calculate all values of Bx(t) and By(t) by using the equation for values of t in increments of "0, 0.01, 0.02....1" (Convert them to integers of course) The smaller your increments, the more accurate your points will be.

    Here’s a C Sample of the DeCasteljau Algorithm (almost the same procedure, but its a bit optimized i believe) 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I posted a previous question here asking about what was better, JOIN queries or
An answer posted for one of my previous questions brings up another question; I
I posted a question about keys yesterday, and got very helpful responses. I've been
I posted a question last night about Java Reflection and am discovering compiler warnings
This is with regard to previous question posted a while ago Remove -1 entry
This question was inspired by a previous question posted on SO, Does the order
This is a continuation of my previous question which I posted when I wasn't
This question is following a previous one which i posted: Django Callback on Facebook
In a previous question I posted (which contains all the code) Unable to substantiate
this is my first question posted on the internet ever, I was usually able

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.