Click here to Skip to main content
15,559,275 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to know what is equation of curve passing through three points.

in mspaint there is tool for drawing curve line, so there are two fix point, and one control point from which u can control the nature of curve.

i want to implement such type of curve..

while searching i got Midpoint Algorithm (Divide and Conquer Method) for Drawing a Simple Bezier Curve[^]

its in c sharp (i want in visual c++)its exactly what i need, but i couldnt figure out what equation is used to draw such curve.
Posted
Updated 18-Nov-11 6:13am
v2
Comments
elgaabeb 18-Nov-11 9:32am    
you wanna the equation or the way of implementing mspaint behavior ??
pranav_30 18-Nov-11 9:38am    
actualy i need only equation suppose there are three point P1(x1,y1), P2(x2,y2), P3(x3,y3) P1 and P3 are fixed point P2 is varying(control point). so for example i want to construct parabola then i can apply equation Y=AX^2+BX+C,

simillarly i want equation for that mspaint curve

1 solution

MSPaint probably uses the PolyBezier() function.

It looks like you already have the equation, I'm not sure why you're asking for the equation. Are you asking for us to solve the algebra equation, to produce the parabolic equation for those points?

Google "Bezier Curves". That's what you're looking for.
 
Share this answer
 
Comments
pranav_30 18-Nov-11 11:18am    
i have google Bezier curves but i am not able to understand. is there any hardcode equation for Bezier curve like circe(X^2+Y^2=R^2) or line(Y=aX+c)
JackDingler 18-Nov-11 13:00pm    
The short answer is yes. But it's not algebraic.

http://en.wikipedia.org/wiki/Bezier_curves

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900