-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreflections.py
More file actions
31 lines (31 loc) · 754 Bytes
/
Copy pathreflections.py
File metadata and controls
31 lines (31 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
docalculation = True
axischeck = False
axis = input("Enter the axis of reflection (x/y): ")
pointx = int(input("Enter the x coordinate of the point: "))
pointy = int(input("Enter the y coordinate of the point: "))
if axis == str("x"):
axischeck = True
axis = int(0)
elif axis == str("y"):
axischeck = True
axis = int(1)
else:
print("Improper axis input.")
axischeck = False
if axischeck == False:
docalculation = False
while axischeck == True:
if axis == 1:
pointxnew = (pointx * -1)
pointynew = pointy
break
elif axis == 0:
pointxnew = pointx
pointynew = (pointy * -1)
break
else:
docalculation = False
break
break
if docalculation == True:
print("Reflected Point: (",pointxnew,",",pointynew,")")