Solving a system of equations

Hey guys, i have a bit of problem here.
I need to write a program where i have an equation (general equation of an elipse) which has six variables! and they also have x and y.(which makes it 8!!) the user enters six different sets of the (x,y) to get six equations. but after that, i.e. after getting six values of x and y, what do i do with my program. lets say, i make the program as follows ( equation is a(x*x) +b(y*y) + cxy + dx + ey +f = 0.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
long double m,n,o,p,q,r,s,t,u,v,w,x;
cout<<"Enter the first x coordinate - ";
cin>>m;
cout<<"Enter the first y coordinate - ";
cin>>n;
cout<<"Enter the second x coordinate - ";
cin>>o;
cout<<"Enter the second y coordinate - ";
cin>>p;
cout<<"Enter the third x coordinate - ";
cin>>q;
cout<<"Enter the third y coordinate - ";
cin>>r;
cout<<"Enter the fourth x coordinate - ";
cin>>s;
cout<<"Enter the fourth y coordinate - ";
cin>>t;
cout<<"Enter the fifth x coordinate - ";
cin>>u;
cout<<"Enter the fifth y coordinate - ";
cin>>v;
cout<<"Enter the sixth x coordinate - ";
cin>>w;
cout<<"Enter the sixth y coordinate - ";
cin>>x;

What do i do with this now?
you already have the equation should be really easy to program but anyways... it would look like this

 
result = ( a * x * x ) + ( b * y * y ) + ( c * x * y ) + ( d * x ) + ( e * y ) + f;


Honestly I don't see 6 x's and y's in your formula.
Also that doesn't look like an ellipse formula to me.
Isn't an ellipse: x2/a2 + y2/b2 = 1

*had a typo
Last edited on
Topic archived. No new replies allowed.