#ifndef LINESEGMENT_CPP
#define LINESEGMENT_CPP

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

using namespace std;

LineSegment::LineSegment() : LineSegment(Point(0,0), Point(1,0)) {}
LineSegment::LineSegment(Point s, Point t) : source(s), target(t) {}

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 {
	double dx = target.getX() - source.getX();
	double dy = target.getY() - source.getY();
	return sqrt(dx*dx + dy*dy);

#endif




