Add tests
This commit is contained in:
2
main.py
2
main.py
@@ -268,5 +268,5 @@ block_list = ["blue_concrete", "red_concrete", "green_concrete",
|
|||||||
|
|
||||||
print(Polyline((Point2D(0, 0), Point2D(0, 10), Point2D(50, 10), Point2D(20, 20))))
|
print(Polyline((Point2D(0, 0), Point2D(0, 10), Point2D(50, 10), Point2D(20, 20))))
|
||||||
|
|
||||||
s = Segment3D(Point3D(0, 0, 0), Point3D(10, 10, 10)).perpendicular(10)
|
s = Segment2D(Point2D(0, 0), Point2D(10, 10)).perpendicular(10)
|
||||||
print(s)
|
print(s)
|
||||||
|
|||||||
@@ -200,6 +200,9 @@ class Segment2D:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List[Point2D]: Two points. First one positioned on the counterclockwise side of the segment, oriented from start to end (meaning left).
|
List[Point2D]: Two points. First one positioned on the counterclockwise side of the segment, oriented from start to end (meaning left).
|
||||||
|
|
||||||
|
>>> Segment2D(Point2D(0, 0), Point2D(10, 10)).perpendicular(10)
|
||||||
|
(Point2D(x: -4, y: 4), Point2D(x: 4, y: -4))
|
||||||
"""
|
"""
|
||||||
delta = self.start.distance(self.end)
|
delta = self.start.distance(self.end)
|
||||||
dx = (self.start.x - self.end.x) / delta
|
dx = (self.start.x - self.end.x) / delta
|
||||||
|
|||||||
Reference in New Issue
Block a user