
# Generamos una elipse muestreando
# equiespaciadamente el ángulo beta


$n = 100;

$a = 180;
$b =  90;
$Xc = 200;
$Yc = 200;
$alfa = 30.0;

$alfa2 = $alfa*3.141592654/180.0;
$c = cos( $alfa2 );
$s = sin( $alfa2 );

$deltaBeta = 2*3.141592654/$n;

for( $i=0; $i<$n; $i++ ){
	$beta = $i*$deltaBeta;

	$t = atan2( $b*sin($beta), $a*cos($beta) ); 

	$x = $a * cos( $t );
	$y = $b * sin( $t );
	$xp = $c*$x - $s*$y + $Xc;
	$yp = $s*$x + $c*$y + $Yc;

	$xi = int( $xp + 0.5 );
	$yi = int( $yp + 0.5 );
	print "$xi $yi\n";
}
