What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Bezier curve formula in C++

Bezier curve formula in C++
Author: Message:
Reaper
Veteran Member
*****

Avatar

Posts: 1393
Reputation: 23
35 / Male / Flag
Joined: Jun 2004
O.P. Bezier curve formula in C++
I need to use a formula and output a variable in C++ but I have an issue. Im using the variable in the forumla but I want the formula to ouput the value of the variable. Sounds complicated so here is my code:

code:
#include <cmath>

#include <iostream>

int v1;

int =v2;

int vc1;

int vc2;

float t;

float ans;

using namespace std;



void main()

{

cout << "Enter v1: ";

cin >> v1;

cout << "Enter v2: ";

cin >> v2;

cout << "Enter vc1: ";

cin >> vc1;

cout << "Enter vc2: ";

cin >> vc2;

ans = (v1 * ((1-t)*(1-t)*(1-t))) + vc1 * (3 * ((1-t)*(1-t))) * t + vc2 * ( 3 * ((1-t) * (t*t)))+ (v2 * (t*t*t));

cout << "Answer = " << ans << endl;

}

Basically, the "t" in the formula is what I want. I need the output to be in terms of "t".

Its kinda hard to explain.
03-26-2008 06:26 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Bezier curve formula in C++ - by Reaper on 03-26-2008 at 06:26 PM
RE: Bezier curve formula in C++ - by Adeptus on 03-26-2008 at 10:16 PM
RE: Bezier curve formula in C++ - by Choli on 03-26-2008 at 10:42 PM
RE: Bezier curve formula in C++ - by mezzanine on 03-26-2008 at 11:01 PM
RE: Bezier curve formula in C++ - by Choli on 03-26-2008 at 11:19 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On