from math import tan, radians
slope = lambda angle: round(tan(radians(angle)), 10)
f = lambda k, x: k * x
g = lambda k, y: y / k
x, y = 1, 6
w, h = 6, 3
angle = 45
top = y
bottom = y - h
left = x
right = x + w
if f(slope(angle), top) >= left and f(slope(angle), top) <= right:
print(f"({int(f(slope(angle), top))}, {top})")
if f(slope(angle), bottom) >= left and f(slope(angle), bottom) <= right:
print(f"({int(f(slope(angle), bottom))}, {bottom})")
if g(slope(angle), left) >= bottom and g(slope(angle), left) <= top:
print(f"({left}, {int(f(slope(angle)), left)})")
if g(slope(angle), right) >= bottom and g(slope(angle), right) <= top:
print(f"({right}, {int(f(slope(angle), right))})")