def getTriangleSides(xA, yA, xB, yB, xC, yC) :
"""
Determine the sides of the triangle defined by 3 points.
Parameters:
xA, yA - Point.
xB, yB - Point.
xC, yC - Point.
Returns:
[d1, d2, d3] - Distances.
"""
A = sR((xC-xB)**2 + (yC-yB)**2)
B = sR((xC-xA)**2 + (yC-yA)**2)
C = sR((xB-xA)**2 + (yB-yA)**2)
return([A, B, C])
def lawOfCos(A, B, C) :
"""
Determine the angles of the triangle defined by 3 sides.
Parameters:
A, B, C - Sides.
Returns:
Angle.
"""
return(iC((B**2 + C**2 - A**2) / (2*B*C)))
def getTriangleAngles(A, B, C) :
"""
Determine the angles of the triangle defined by 3 sides.
Parameters:
A, B, C - Sides.
Returns:
[a, b, c] - Angles.
"""
a = lawOfCos(A, B, C)
b = lawOfCos(B, C, A)
c = lawOfCos(C, A, B)
return([a, b, c])