import mx.core.UIComponent;
import Protractor;
import RimPoint;
import ProtractorContainer;
class Triangle extends UIComponent {
	var prot:Protractor;
	var p:RimPoint;
	function Triangle(){
		prot = _parent.prot;
		p = _parent.p;
	}
	function draw() {
		clear();
		lineStyle(1, 0, 100);
		moveTo(0,0);
		lineTo(p._x,0);
		lineTo(p._x,p._y);
		lineTo(0,0);
		
		// draw angle
		lineStyle(0,0,0);
		beginFill(0x888800,50);
		for(var i=0; i < -p.angle; i+=Math.PI/180) {
			lineTo(20*Math.cos(-i),20*Math.sin(-i));
		}
		endFill();
	}
}
