Skip to content

Commit

Permalink
Merge pull request #27 from FLming/master
Browse files Browse the repository at this point in the history
fix: Point class __repr__ str fix to (x, y) instead of (x, x)
  • Loading branch information
Yatoom authored May 15, 2024
2 parents e3c41df + 51f9d94 commit 84ae297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions foronoi/graph/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def norm(vector):
@staticmethod
def line_ray_intersection_point(ray_orig, ray_end, point_1, point_2):
# Convert to numpy arrays
orig = np.array(ray_orig, dtype=np.float)
end = np.array(ray_end, dtype=np.float)
direction = np.array(Algebra.norm(end - orig), dtype=np.float)
point_1 = np.array(point_1, dtype=np.float)
point_2 = np.array(point_2, dtype=np.float)
orig = np.array(ray_orig, dtype=float)
end = np.array(ray_end, dtype=float)
direction = np.array(Algebra.norm(end - orig), dtype=float)
point_1 = np.array(point_1, dtype=float)
point_2 = np.array(point_2, dtype=float)

# Ray-Line Segment Intersection Test in 2D
# http://bit.ly/1CoxdrG
Expand Down
2 changes: 1 addition & 1 deletion foronoi/graph/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, x=None, y=None, name=None, first_edge=None):
def __repr__(self):
if self.name is not None:
return f"P{self.name}"
return f"Point({self.xd:.2f}, {self.xd:.2f})"
return f"Point({self.xd:.2f}, {self.yd:.2f})"

def area(self, digits=None):
"""
Expand Down

0 comments on commit 84ae297

Please sign in to comment.