Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Finding coordinations for 2 vertexes of an equilateral triangle
- I have an equilateral triangle with known coordinations of one vertex (a,b).
- I know that each side's length is t and the coordinations of the other vertexes (x1, y1), (x2, y2).
- There is another point (c, d) which creates with (a,b) a segment in length k that is perpendiculars to the opposite side of (a,b).
- I need to express x1, y1, x2 and y2 with the given parameters a, b, c, d, t and k.
- I started with four equations:
- Because we have perpendicular segments, we can say that their slopes's product equals -1.
- 1) (d-b)/(a-b)=(x2-x1)/(y2-y1).
- It is also known that the distance between each two vertexes is t, so expressing each side with the given coordinations gives us another three equations:
- 2) (a-x1)^2 + (b-y1)^2 = t^2
- 3) (a-x2)^2 + (b-y2)^2 = t^2
- 4) (x2-x1)^2 + (y2-y1)^2 = t^2
- I tried solving the equation and got the following answers:
- x1 = a-t*(d-b+sqrt(k^2-3*(d-b)^2))/(2*k)
- y1 = b+t*((d-b)*sqrt(k^2-3*(d-b)^2)-(a-c)^2)/(2*k*(a-c))
- x2 = a-t*(d-b-sqrt(k^2-(d-b)^2))/(2*k)
- y2 = b+t*(2*(d-b)*(a-c)-(a-c)^2+(d-b)*sqrt(k^2-3*(d-b)^2))/(2*k*(a-c))
- I tried to substitute some numbers for the parameters but it doesn't get right.
- I'll be really glad if you could help me.
- Thank you
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement