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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:57:42+00:00 2026-05-23T00:57:42+00:00

I have a dataset with about 50 points (x,y) and I would like to

  • 0

I have a dataset with about 50 points (x,y) and I would like to draw a smooth curve that can pass as closer as possible on those points.

I have heard about Casteljau’s algorithm for splines but after hours searching on google I was not able to find a single piece of code I can use.

As far as I understood, to use this algorithm, I have to divide my dataset in groups of 4 points, right? 1234 5678 etc.. and as far as I noticed, my only problem is to find the points in the middle of each group. I mean, if I am calculating a curve for points 1234, I already have points 1 and 4 and I need to calculate 2 and 3, right? But it is a mystery to me how to do that.

I would like to ask you guys if you know some code in C, C++ or Objective-C that computes the curves based on datasets with any amount of number.

What I need is: I send the code an array with the dataset and I receive back an array with the points to draw.

My math is rusty. So, please give me practical examples. Do not send me to pages with math theory and equations. Looking at these pages makes my brain hurt…

Just tell me what to do with the points I have to compute the bezier.

Answer as you would ask a 10 year old child… 😀

thanks.

  • 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-23T00:57:43+00:00Added an answer on May 23, 2026 at 12:57 am

    How about in C#?

    private void drawCasteljau(List<point> points) {
                Point tmp;
                for (double t = 0; t <= 1; t += 0.001) { 
                    tmp = getCasteljauPoint(points.Count-1, 0, t);
                    image.SetPixel(tmp.X, tmp.Y, color);
                }
            }
    
    
        private Point getCasteljauPoint(int r, int i, double t) { 
            if(r == 0) return points[i];
    
            Point p1 = getCasteljauPoint(r - 1, i, t);
            Point p2 = getCasteljauPoint(r - 1, i + 1, t);
    
            return new Point((int) ((1 - t) * p1.X + t * p2.X), (int) ((1 - t) * p1.Y + t * p2.Y));
        }
    

    From Here:

    http://protein.ektf.hu/book/export/html/51

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

Sidebar

Related Questions

I have a collection with about 500000 dataset in it and I like to
We have a Dataset with about 40 TableAdapters on it. These are used everywhere
I have a large data set that I'm working with in excel. About 1000+
I have a bunch of csv datasets, about 10Gb in size each. I'd like
I have a dataset that i am trying to set the default value as
(R beginner here...) I have a dataset like: > head(q) Date Time System User
Let's say I have a DataGridView Control that displays about 100 records of a
I have data that looks like: x1 y1 z1 x2 y2 z2 val1 val2
I have a DataSet that contains a few columns. One of these columns is
Interpolating Large Datasets I have a large data set of about 0.5million records representing

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.