basictypes: working well with lines
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
5d73bca7ba
commit
80733cbedb
@ -74,7 +74,7 @@ class Line:
|
||||
class WallIDMismatch (RuntimeError): ...
|
||||
|
||||
# Helper methods
|
||||
def polar_to_cart(self, r, theta_deg) -> tuple:
|
||||
def polar_to_cart(r, theta_deg) -> tuple:
|
||||
#print('polar to cart ',r, theta_deg)
|
||||
x = r * math.cos(deg_to_rad(theta_deg))
|
||||
y = r * math.sin(deg_to_rad(theta_deg))
|
||||
@ -82,3 +82,7 @@ def polar_to_cart(self, r, theta_deg) -> tuple:
|
||||
|
||||
def deg_to_rad(theta_deg) -> float:
|
||||
return theta_deg*(math.pi/180)
|
||||
|
||||
def point_from_polar(r, theta, wall_id) -> PointWithID:
|
||||
x, y = polar_to_cart(r, theta)
|
||||
return PointWithID(x, y, wall_id)
|
||||
|
Loading…
Reference in New Issue
Block a user