Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_x = 1
- b_x = (-2 * point[0]) # point[0] = x-coordinate of point
- c_x = point[0]**2 + point[1]**2 - C**2 # point[1] = y-coordinate of point
- d_x = (b_x**2) - (4 * a_x * c_x)
- sqr_d_x = cmath.sqrt(d_x) # Takes the square root of d_x
- x_1 = (-b_x - sqr_d_x)/(2 * a_x) #Sol 1,x-coordinate of base vertice
- x_2 = (-b_x + sqr_d_x)/(2 * a_x) #Sol 2,x-coordinate of base vertice
- Pw_x = min(x_1,x_2) # Since isosceles triangle is slanted on 2D space
- Pz_x = max(x_1,x_2)
- a_y = 1
- b_y = (-2 * point[1])
- c_y = point[0]**2 + point[1]**2 - C**2
- d_y = (b_y**2) - (4 * a_y * c_y)
- sqr_d_y = cmath.sqrt(d_y)
- y_1 = (-b_y - sqr_d_y)/(2 * a_y)
- y_2 = (-b_y + sqr_d_y)/(2 * a_y)
- Pw_y = max(y_1,y_2)
- Pz_y = min(y_1,y_2)
- Pw = (Pw_x,Pw_y) # left base vertice
- Pz = (Pz_x,Pz_y) # right base vertice
- print(cmath.sqrt((point[0] - Pw_x)**2 + (point[1] - Pw_y)**2))
- print(cmath.sqrt((point[0] - Pz_x)**2 + (point[1] - Pz_y)**2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement