0

I have an isosceles triangle, of which I know $\hat{CAB}$, $A(x, y)$ and $B(x, y)$, and from these two point I can obtain $c_1$ (and $b$, which is equal to $c_1$).

enter image description here

What I need is to find the formula to get $C_x$ and $C_y$.

My question is similar to this one: Calculate coordinates of 3rd point (vertex) of a scalene triangle if angles and sides are known. but this time the triangle should be isosceles, and I think that the formula above do not work for this type of triangle.

I also looked at this: Calculate Third Point of Triangle but I think it's different because the vertex needed is not one of the two base vertex.

Matteo Secco
  • 137
  • 1
  • 7
  • Do you know how to compute the rotation of a point? – amd Jan 18 '17 at 19:13
  • The purpose of this is to rotate a triangle, B should be the old vertex and C the new one. And I have to do this also to the other two vertex of the hypotethic triangle. @amd – Matteo Secco Jan 18 '17 at 19:15
  • So, are you essentially trying to derive a formula for rotation? – amd Jan 18 '17 at 19:20
  • Yes, this is the only way to do it...or not? – Matteo Secco Jan 18 '17 at 19:24
  • Right, then. Think about the symmetry of the pictured triangle. What can you say about the line segment $\overline{BC}$ relative to the line of symmetry? – amd Jan 18 '17 at 19:41
  • It divides CB in two part, CD and CB, which are the bases the right triangles ACD and ABD, right? – Matteo Secco Jan 18 '17 at 19:51
  • I think I've finally found the solution here: http://stackoverflow.com/questions/34372480/rotate-point-about-another-point-in-degrees-python – Matteo Secco Jan 18 '17 at 20:08
  • If all you wanted was the formula for rotation, you could’ve found it on wikipedia or elsewhere without much trouble. If you have to solve this for yourself, that’s a different matter. – amd Jan 18 '17 at 20:10

1 Answers1

0

I finally found the solution. To find $C_x$ and $C_y$ you have to rotate $B$ for $a$ radians. Here is the formula:

Cx = Ax + math.cos((a) * (Bx - Ax) - math.sin((a) * (By - Ay)
Cy = Ay + math.sin((a) * (Bx - Ax) + math.cos((a) * (By - Ay)

You actually have to check in what quadrant is the point you want to rotate, to make sure that it will always rotate in the same direction (In this case it rotates in a clockwise direction).

# Written in Python 3.5.1
import math
vertex = (20.338, -12.43785)
center = (12.5335, -11.56375)
a = 150 # degrees
a = a*0.0175 # radians
if vertex[0] > center[0] and vertex[1] >= center[1]:
    qx = center[0] + math.cos((-a)) * (vertex[0] - center[0]) - math.sin((-a)) * (vertex[1] - center[1])
    qy = centro[1] + math.sin((-a)) * (vertice[0] - centro[0]) + math.cos((-a)) * (vertice[1] - centro[1])
elif vertex[0] >= center[0] and vertex[1] < center[1]:
    qx = centex[0] + math.cos((a)) * (vertex[0] - center[0]) - math.sin((-a)) * (vertex[1] - center[1])
    qy = center[1] + math.sin((-a)) * (vertex[0] - center[0]) + math.cos((a)) * (vertex[1] - center[1])
elif vertex[0] < center[0] and vertex[1] <= center[1]:
    qx = center[0] + math.cos((-a)) * (vertex[0] - center[0]) - math.sin((-a)) * (vertex[1] - center[1])
    qy = center[1] + math.sin((-a)) * (vertex[0] - center[0]) + math.cos((-a)) * (vertex[1] - center[1])
elif vertex[0] <= center[0] and vertex[1] > center[1]:
    qx = center[0] + math.cos((a)) * (vertex[0] - center[0]) - math.sin((-a)) * (vertice[1] - centro[1])
    qy = center[1] + math.sin((-a)) * (vertex[0] - center[0]) + math.cos((a)) * (vertex[1] - center[1])
print("("+str(round(qx, 3))+",", str(round(qy, 3))+")")
Matteo Secco
  • 137
  • 1
  • 7