//Készítette:   Gregorics Tibor
//Dátum:        2008.12.06.
//Feladat:      Gömb típus

#ifndef _GOMB_H
#define _GOMB_H

#include "pont.h"

//Típusértékek: gömbök
//Reprezentáció:Középponttal (Pont) és a sugárral (double), ami nem lehet negatív
//Műveletek:    bool In(Pont p) - Benne van-e egy pont a gömbben
class Gomb{
    private:
        Pont c;
        double r;
    public:
        enum Hiba { Negativ_Sugar };
        Gomb(const Pont &p, double a)
            { if (a<0) throw Negativ_Sugar; c=p; r=a;  }
        bool Benne(const Pont &p)
            { return c.Tavolsag(p)<=r; }
};

#endif

