Anyone good at math?


Recommended Posts

Need help with a math problem:

The general form of a conic is Ax^2 + Bxy + Cx^2 + Dx + Ey + F = 0.

A hyperbola is formed when B = 0 and A & C have different signs.

Question: What are the coordinates of the hyperbola's center in terms of A,B,C,D,E, and F?

Link to comment
Share on other sites

I would know this if I had my math book with me, but someone borrowed it during Friday's math class and didn't give it back. We are way past Conic Sections so I don't quite remember what the rule was for finding this.

Good luck.

Link to comment
Share on other sites

never mind, I figured it out:

<pre>

 	 if(A == C && B == 0)

    cout<<"Circle, ("<<(D/2)*-1/A<<","<<(E/2)*-1/A<<"), "<<sqrt(-1*F/A+pow(D/(2*A),2)+pow(E/(2*A),2))<<endl;

 	 else if(A != C && ((A > 0 && C > 0) || (A < 0 && C < 0)) && B == 0)

    {

    checked = (-1*F+A*pow(D/(2*A),2)+C*pow(E/(2*C),2))/A;

    if((-1*F+A*pow(D/(2*A),2)+C*pow(E/(2*C),2))/C > checked)

   	 checked = (-1*F+A*pow(D/(2*A),2)+C*pow(E/(2*C),2))/C;

    cout<<"Ellipse, ("<<(D/2)*-1/A<<","<<(E/2)*-1/C<<"), "<<2*sqrt(checked)<<endl;

    }

 	 else if((A == 0 || C == 0) && B == 0)

    {

    if(C == 0)

   	 cout<<"Parabola, ("<<-1*D/(2*A)<<","<<(-1*(D*D/(4*A))-F)/E<<"), x="<<-1*D/(2*A)<<endl;

    else

   	 cout<<"Parabola, ("<<(-1*(E*E/(4*C))-F)/D<<","<<-1*E/(2*C)<<"), y="<<-1*E/(2*C)<<endl;

    }

 	 else if(((A > 0 && C < 0) || (A < 0 && C > 0)) && B == 0)

    if(A > 0)

   	 cout<<"Hyperbola, ("<<-1*D/(2*A)<<","<<-1*E/(2*C)<<"), y="<<-1*E/(2*C)<<endl;

    else

   	 cout<<"Hyperbola, ("<<-1*D/(2*A)<<","<<-1*E/(2*C)<<"), x="<<-1*D/(2*A)<<endl;

 	 else

    cout<<"Error."<<endl;

</pre>

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.