Revision 2d2701a8a8669add9e3db8661d8d773db7cedf1a authored by Rene Brun on 15 July 2003, 14:25:22 UTC, committed by Rene Brun on 15 July 2003, 14:25:22 UTC
 - mode in TGLVcontainer::SetViewMode  method
   That fixes layout problem in tree viewer
 - new constructor for TGPictureButton
 - code cleaning


git-svn-id: http://root.cern.ch/svn/root/trunk@6938 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 063f657
Raw File
Quad.cxx
#include <math.h>
#include "Riostream.h"
#include "Quad.h"

Quad::Quad(Float_t a,Float_t b,Float_t c)
{
   fA = a;
   fB = b;
   fC = c;
}

Quad::~Quad()
{
   cout << "deleting object with coeffts: "
        << fA << "," << fB << "," << fC << endl;
}

void Quad::Solve() const
{
   Float_t temp = fB*fB -4*fA*fC;
   if (temp > 0) {
      temp = sqrt(temp);
      cout << "There are two roots: "
           << ( -fB - temp ) / (2.*fA)
           << " and "
           << ( -fB + temp ) / (2.*fA)
           << endl;
   } else {
      if (temp == 0) {
         cout << "There are two equal roots: "
         << -fB / (2.*fA) << endl;
      } else {
         cout << "There are no roots" << endl;
      }
   }
}

Float_t Quad::Evaluate(Float_t x) const
{
  return fA*x*x + fB*x + fC;
  return 0;
}
back to top