GeometricFigure.prototype.GetArea = GeometricFigure_GetArea;
GeometricFigure.prototype.Draw = GeometricFigure_Draw;

// costruttore
function GeometricFigure(){
	console.log("Geometric Figure");
}

// restituisci l'area
function GeometricFigure_GetArea(){
	return this.area;
}

function GeometricFigure_Draw(){
	alert("chiama funzione di disegno");
}

function Circle_Draw(){
	var canvas = document.getElementById("canvas");
	var ctx = canvas.getContext("2d");
	ctx.beginPath();
	ctx.lineWidth = 1;
	ctx.arc(200, 200, this.r, 0, Math.PI*2);
	ctx.stroke();
}

Circle.prototype = new GeometricFigure();
Circle.prototype.Draw = Circle_Draw;

function Circle(r) {
	this.r = r;
	this.area = Math.PI * r * r;
	console.log(this.area);
}

var cerchio = new Circle(10);
var area = cerchio.GetArea();
console.log("AREA: " + area);


document.addEventListener("DOMContentLoaded", function(){
	cerchio.Draw();
}, false);

