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

package Capitulo_8.Pendulo;

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

/**
 *
 * @author felix
 */
public class Objeto {
    private double theta;
    private int x0, y0;
        
    public Objeto(int unX, int unY, double unTheta) {
        theta = unTheta;
        x0 = unX;
        y0 = unY;
    }
    
    int getX() {
        return (int) (x0 + 100.0 * Math.cos(theta)) ;
    }

    int getY() {
        return (int) (y0 + 100.0 * Math.sin(theta)) ;
    }
    
    public void dibuja(Graphics g) {
        g.setColor(Color.BLACK);
        g.fillOval(getX(), getY(), 10, 10);
    } 
    
    public void mueve() {
        theta += 0.01;
    }
}
