Commit Graph

17 Commits

Author SHA1 Message Date
048f6a08e6 Add function intersection for line segments 2020-03-09 20:15:56 +01:00
5fc13e0e07 Fix method set_y 2020-03-09 20:14:39 +01:00
70bb80e445 FIx comments 2020-03-09 19:18:07 +01:00
978bb9b789 Add function to generate random line segments 2020-03-09 18:51:41 +01:00
c96c1fc8bc Rename sort method for points 2020-03-09 18:43:24 +01:00
2d4ee80b4c Move set_random() out of class
As generating a random Point is mostly not used on an existing object,
the method is now an independent function get_random() instead of a
class method.
2020-03-09 18:42:46 +01:00
f19dcee20b Modify algorithm module to be more common to use
Method exec() is now in base class algorithm and called run().
The algorithm class should now be better to use for various algorithms.
2020-03-09 18:18:52 +01:00
7210a94995 Convert sweep module and class to algorithm
Since an algorithm can use more than one sweep, the sweep class doesn't
fit very good as it is right now. For this reasen it got converted to a
more general class named algorithm, that shall be used as parent for
every individual algorithm. The exact behaviour of the algorithm is
then defined in the child classes.
2020-03-09 17:41:37 +01:00
0065733bcf Add MIT license to the project 2020-03-09 09:47:03 +01:00
Pascal Lais
1a53f7aaa1 Enable unsafe-load-any-extension for pylint 2020-03-09 07:51:13 +01:00
Pascal Lais
d8cc7fc6f9 Add sweep module
The sweep module contains a sweep class and a class for the nearest
neighbor sweep alorithm.
2020-03-09 07:50:28 +01:00
Pascal Lais
4a483b939a Add method str to linesegment
The method str returns the line segment coordinates as string.
2020-03-09 07:49:10 +01:00
Pascal Lais
6f83b57ffb Add sort function and class methods to class Point
The sort function takes a list of Point objects and sorts them either
by their x or y coordinate using merge sort.
Also added a method set_random, that sets the coordinates to random
values and a method str, that returns the coordinates as string.
2020-03-09 07:48:07 +01:00
Pascal Lais
778240a1d3 Add linesegment module
The module defines a LineSegment class that displays a line segment in
two-dimensional coordinate system. It is defined by a start- and an
endpoint. It also contains a method to calculate the length.
2020-03-08 11:00:14 +01:00
Pascal Lais
a14f96ab2a Add point module
The point module defines a Point class, that displays a Point in a
two-dimensional coordinate system. An object of the class contains a x-
and y-coordinate and a setter and getter method for each at this point.
2020-03-08 10:57:40 +01:00
Pascal Lais
5df3f47563 Add code-vorkspace files to .gitignore 2020-03-07 12:00:23 +01:00
87ab6091b3 Initial commit 2020-03-07 08:39:25 +01:00