#include<iostream>
#include<cmath>
#include "rectangle.h"
using namespace std;

Rectangle::Rectangle():Quadrilateral()
{
	a = Point(1,3);
	b = Point(5,3);
	c = Point(5,5);
	d = Point(1,5);
}

Rectangle::Rectangle(Point &p1, Point &p2, Point &p3, Point &p4):
			Quadrilateral(p1,p2,p3,p4)
{
	validate();
}

void Rectangle::SetAll(Point &p1, Point &p2, Point &p3, Point &p4)
{
	Quadrilateral::SetAll(p1,p2,p3,p4);
	validate();
}

double Rectangle::Perimeter()
{
	double side1 = a.Distance(b);
	double side2 = b.Distance(c);
	double side3 = c.Distance(d);
	double side4 = d.Distance(a);
	return(side1 + side2 + side3 + side4);
}

double Rectangle::Area()
{
	double side1 = a.Distance(b);
	double side2 = b.Distance(c);
	double side3 = c.Distance(d);
	double side4 = d.Distance(a);
	return(side1 * side2);
}

void Rectangle::Print()
{
	cout << "I'm a Rectangle" << endl;
	Quadrilateral::Print();
}

