/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Capitulo_6.Dibujo2;

import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * @author felix
 */

public class Circulo implements Figura{
    private int x0, y0, radio;
    Color c;

    @Override
    public void set(int x0, int y0, int x1, int y1, Color c) {
        int dx;
        
        this.x0 = x0;
        this.y0 = y0;
        radio = (int) Math.sqrt((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
              
        this.c = c;     
    }

    @Override
    public void dibuja(Graphics g) {
        g.setColor(c);
        g.drawOval(x0-radio, y0-radio, 2*radio, 2*radio);
    }    
}
