#ifndef LINESEGMENT_CPP
#define LINESEGMENT_CPP

#include <iostream>
#include <cmath>
#include "LineSegment.hpp"

using namespace std;

int LineSegment::count = 0;
int LineSegment::computationCount = 0;

LineSegment::LineSegment() : LineSegment(new Point(0,0),new Point(1,1)) {}
LineSegment::LineSegment(Point* s, Point* t) : source(s), target(t) {count +=1;}

Point* LineSegment::getSource() const {return source;}
Point* LineSegment::getTarget() const {return target;}

void LineSegment::setSourse(Point* s) {source = s;}
void LineSegment::setTarget(Point* t) {target = t;}

void LineSegment::output() const {
	source->output();
	cout << "->" ;
	target->output();

	}

void LineSegment::input() {
	cout << "Enter source point: " <<endl;
	source.input();
	Cout << "Enter target point: " <<endl;
	target->input();

	}

double LineSegment::lenght() const {
	computaionCount +=1;
	double dx = target.getX() - source->getX();
	double dy = target.getY() - source->getY();
	return sqrt(dx*dx + dy*dy);

int LineSegment::getCount(){return count;}
int LineSegment::getComputationCount(){return computationCount;}
#endif




