Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ImageProcessing
I have curve that is displayed by collection of points connected with lines. I have to replace that kind of curve with one cubic bezier curve. I have origin and destination point, but I don't know how to calculate two control points.
 
Question improved:
 
I have curve consisting of 4 points (p0, p1, p2 and p3). p0 is origin point and p3 is destination point. p1 and p2 are two point in the middle. If I connect these 4 points I will get 3 lines. I want to replace that 3-line-curve with cubic bezire curve. To get that, I have to calculate positions of two control points of cubic bezier curve. My question is how?
In meantime I found few articles (http://www.moshplant.com/direct-or/bezier/math.html[^]) that describes how to draw cubic bezier curve, so I will try to reverse-engineer these formulas to get control points.
Posted 27-Apr-11 9:25am
Edited 27-Apr-11 11:25am
v2
Comments
Manfred R. Bihy at 27-Apr-11 16:11pm
   
Unclear to say the least.
If you only have the origin and the destination point the best you can hope for is a straight line. Please formulate your exact requirments in four or more statements.
Thanks for your cooperation!
Manfred R. Bihy at 27-Apr-11 16:39pm
   
Thanks for improving your question! See my answer for a link to a CP article that should help you!
Member 2784779 at 28-Apr-11 4:13am
   
Manfred, thank you for fast answer. This is what I need!

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please have a look here: Draw a Smooth Curve through a Set of 2D Points with Bezier Primitives[^]. The article is for C# but since you didn't specify any language I thought I just post this.
 
Best regards,
 
-MRB
  Permalink  
Comments
SAKryukov at 27-Apr-11 22:16pm
   
Could help, my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Praneet Nadkar 197
3 Sergey Alexandrovich Kryukov 190
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 27 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100