Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import matplotlib.pyplot as plt
- screen_x, screen_y = (500, 500)
- middle_screen = (screen_x/2, screen_y/2)
- # point behind the middle
- point_behind = (middle_screen[0], -750)
- # middle point to the left
- middle_point_in_screen = (middle_screen[0]-50, middle_screen[1])
- # y = mx + b, y-y1 = m(x-x1)
- radius_midpoint = 1250
- # find a the slice of the circle from the middle
- min_range = math.pi/2 - math.sin((middle_screen[1] - point_behind[1])/radius_midpoint)
- max_range = math.pi/2
- # pi/4 => pi/2
- def create_list_rad(min_range, max_range = math.pi/2):
- min_pi = min_range
- radian_list = []
- while min_pi< max_range:
- radian_list.append(min_pi)
- min_pi += .001
- return radian_list
- def find_xy(r, theta):
- return (int(r*math.cos(theta)), int(r*math.sin(theta)))
- x_y_list = []
- for i in create_list_rad(min_range):
- x_y_list.append(find_xy(radius_midpoint, i))
- print(x_y_list)
- x, y = list(zip(*x_y_list))
- print(x)
- print(y)
- plt.plot(x,y)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement