Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x1 = 200
- y1 = 400
- x2 = 700
- y2 = 200
- dist = 20
- x3 = (x1 + x2) / 2
- y3 = (y1 + y2) / 2
- a = x2-x1
- b = y1 - y2
- norm = sqrt(a*a + b*b)
- a = a / norm
- b = b / norm
- x4 = x3 + a * dist
- y4 = y3 + b * dist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement