PHSphere.C
//---------------------------------------------------------------------------------------
// Class: PHSphere
//
// Written by: Jane M. Burward-Hoy and Federica Messer
//
// Purpose: A Sphere
//
// Last update: 10/28/99
//
// Pioneered by J. Mitchell
//
// Details: the sphere is defined by its center, its radius
//----------------------------------------------------------------------------
#include "PHSphere.h"
PHSphere::PHSphere()
{
radius = 1;
}
PHSphere::PHSphere(double r,const PHPoint point)
{
radius = r;
center = point;
}
PHSphere::PHSphere(const PHSphere &cyl)
{
center = cyl.center;
radius = cyl.radius;
}
PHSphere::~PHSphere()
{
}
PHSphere& PHSphere::operator= (const PHSphere &cyl)
{
center = cyl.center;
radius = cyl.radius;
return *this;
}
void PHSphere::print() const
{
cout << "Radius : " << radius << " " << center << endl;
}
ostream& operator<<(ostream& os, const PHSphere &cylinder)
{
os << "Radius : " << cylinder.radius << " " << cylinder.center << endl;
return os;
}