Click here to Skip to main content
15,889,595 members
Home / Discussions / Algorithms
   

Algorithms

 
Questiondfgfdg Pin
Gul zeb14-Sep-06 2:13
Gul zeb14-Sep-06 2:13 
Generalfdfdsf Pin
Gul zeb13-Sep-06 21:43
Gul zeb13-Sep-06 21:43 
GeneralRe: fdfdsf Pin
Ed.Poore14-Sep-06 1:04
Ed.Poore14-Sep-06 1:04 
QuestionBezier curve, Newton-Raphelson method, formula problem, please help! [modified] Pin
srev13-Sep-06 4:29
srev13-Sep-06 4:29 
AnswerRe: Bezier curve, Newton-Raphelson method, formula problem, please help! Pin
El Corazon13-Sep-06 16:14
El Corazon13-Sep-06 16:14 
GeneralRe: Bezier curve, Newton-Raphelson method, formula problem, please help! Pin
srev13-Sep-06 23:42
srev13-Sep-06 23:42 
AnswerRe: Bezier curve, Newton-Raphelson method, formula problem, please help! Pin
ejuanpp13-Sep-06 22:00
ejuanpp13-Sep-06 22:00 
GeneralRe: Bezier curve, Newton-Raphelson method, formula problem, please help! Pin
srev13-Sep-06 23:40
srev13-Sep-06 23:40 
Guys,

Thanks so much for everyone's feedback. From all the feedback on this and other forums I have the answer.

The function CalcBezierValue() computes the cubic Bézier curve as the polynomial:
x = A*t^3 + 3*B*(t^2)*(1-t) + 3*C*t*(1-t)^2 + D*(1-t)^3

To use the technique in the article I need the derivative:
x' = 3*A*t^2 + 6*B*t*(1-t) - 3*B*t^2 + 3*C*(1-t)^2 - 6*C*t*(1-t) - 3*D*(1-t)^2

The final code looks like this:

// Calc the derivative value of the curve at the specified percentage (rather than the polynomial)
public float CalcBezierDerivative(float P, float A, float B, float C, float D)
{
P = 1 - P; // Reverse the normalised percentage

float tR = 3 * A * (P * P);
float tS = 6 * B * P * (1 - P);
float tT = 3 * B * (P * P);
float tU = 3 * C * ((1 - P) * (1 - P));
float tV = 6 * C * P * (1 - P);
float tW = 3 * D * ((1 - P) * (1 - P));

return tR + tS - tT + tU - tV - tW;
}

Many thanks for all your responses.

Simon
General44th Mersenne Prime Discovered Pin
Bassam Abdul-Baki13-Sep-06 3:10
professionalBassam Abdul-Baki13-Sep-06 3:10 
GeneralRe: 44th Mersenne Prime Discovered Pin
Paul Conrad13-Sep-06 20:32
professionalPaul Conrad13-Sep-06 20:32 
QuestionImpossible Numbers Pin
ricecake8-Sep-06 4:13
ricecake8-Sep-06 4:13 
AnswerRe: Impossible Numbers Pin
Kacee Giger8-Sep-06 13:13
Kacee Giger8-Sep-06 13:13 
GeneralRe: Impossible Numbers Pin
ricecake8-Sep-06 13:24
ricecake8-Sep-06 13:24 
Questionnth root? Pin
Steve Echols5-Sep-06 19:21
Steve Echols5-Sep-06 19:21 
AnswerRe: nth root? Pin
ejuanpp5-Sep-06 23:07
ejuanpp5-Sep-06 23:07 
GeneralRe: nth root? Pin
Steve Echols6-Sep-06 4:44
Steve Echols6-Sep-06 4:44 
AnswerRe: nth root? Pin
Sauruxum23-Jun-10 2:43
Sauruxum23-Jun-10 2:43 
QuestionCrypto Formula Malfunction Pin
rawstar5-Sep-06 6:34
rawstar5-Sep-06 6:34 
AnswerRe: Crypto Formula Malfunction Pin
Paul Conrad14-Jul-07 10:21
professionalPaul Conrad14-Jul-07 10:21 
QuestionMAP Pin
MHASSANF4-Sep-06 22:36
MHASSANF4-Sep-06 22:36 
Questionwhat are the codes of this Pin
robeelyn2-Sep-06 5:18
robeelyn2-Sep-06 5:18 
AnswerRe: what are the codes of this Pin
Ed.Poore2-Sep-06 9:39
Ed.Poore2-Sep-06 9:39 
GeneralRe: what are the codes of this Pin
Paul Conrad2-Sep-06 12:22
professionalPaul Conrad2-Sep-06 12:22 
GeneralRe: what are the codes of this Pin
Ed.Poore2-Sep-06 13:16
Ed.Poore2-Sep-06 13:16 
GeneralRe: what are the codes of this Pin
Paul Conrad3-Sep-06 5:54
professionalPaul Conrad3-Sep-06 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.