From 94ad6def57670901bd88621c6083ad34723025c6 Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Mon, 16 Mar 2020 19:46:36 +0100 Subject: [PATCH] Update linesegment.py Don't sort start and endpoint by x coordinate --- linesegment.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/linesegment.py b/linesegment.py index 7837627..758c293 100644 --- a/linesegment.py +++ b/linesegment.py @@ -9,12 +9,8 @@ class LineSegment: starting at a startpoint and ending at a endpoint.""" def __init__(self, startpoint=point.Point(), endpoint=point.Point()): """Initialize the line segment.""" - if startpoint.get_x() <= endpoint.get_x(): - self.set_startpoint(startpoint) - self.set_endpoint(endpoint) - else: - self.set_startpoint(endpoint) - self.set_endpoint(startpoint) + self.set_startpoint(startpoint) + self.set_endpoint(endpoint) def set_startpoint(self, new_startpoint): """Set or change the startpoint of the line segment. If not a Point object is given the startpoint gets set to a default value of Point(0,0)."""