0

Given that we know the lengths of the sides of a triangle (SSS), how can the coordinates of the vertices in the Euclidean plane of such a triangle be mathematically computed?

I'm especially looking for a mathematical algorithm to solve this problem. Coordinates would be simple to calculate using a pen and paper, a ruler, and a compass. But how can they be computed?

I see that using the SSS theorem (essentially the law of cosines), the angles of the triangle can be found.

Example:

$XY$ is the line segment connecting two points $X$ and $Y$, where $|XY|$ is the length of segment $XY$.

Given we know $|AB| = 3$, $|BC| = 4$ and $|AC| = 5$, how can we calculate any coordinates of the vertices $A$, $B$ and $C$ that satisfy the given lengths?

Here, an example solution would be $A = (0, 0)$, $B = (1.8, 2.4)$ and $C = (5, 0)$. Of course, lots of other sets of three coordinates would satisfy the given lengths.

Edit: Solution implemented in Python 3

I needed this for creating a program. Here is an implementation of amd's solution in Python 3:

from decimal import Decimal # Decimal used for extra precision

def print_coordinates_of_triangle_given_SSS(a, b, c):
    """a, b and c are lengths of the sides of a triangle"""

    A = (0, 0) # coordinates of vertex A

    B = (c, 0) # coordinates of vertex B

    C_x = b * Decimal(b**2 + c**2 - a**2) / (2 * b * c)
    C_y = Decimal(b**2 - C_x**2).sqrt() # square root

    C = (float(C_x), float(C_y)) # coordinates of vertex C

    # print
    vertices = zip(["A = ", "B = ", "C = "], [A, B, C])
    print('\n'.join([v[0] + str(v[1]) for v in vertices]))

# test -- print coordinates of triangle given sides of length 3, 4 and 5
print_coordinates_of_triangle_given_SSS(3, 4, 5)

It prints possible coordinates of a triangle given the lengths of its sides.

print_coordinates_of_triangle_given_SSS(3, 4, 5) will print

A = (0, 0)
B = (5, 0)
C = (3.2, 2.4)
paaskus
  • 3
  • 5

2 Answers2

0

I would do the following. Let the lengths be $a, b, c$

  1. Take the first length $a$. Make the first point $(-\frac{a}{2}, 0)$, and the second point $(\frac{a}{2}, 0)$.
  2. Draw a circle of radius $b$ centered at $(-\frac{a}{2}, 0)$, and another circle of radius $c$ centered at $(\frac{a}{2}, 0)$.
  3. Use the steps delineated here to find the points of intersection of the two circles. Both points are possibilities for the third point.

enter image description here

0

In order to reduce clutter, let $a=|BC|$, $b=|AC|$ and $c=|AB|$. W.l.o.g. place $A$ at the origin and $B$ at $(c,0)$. The $x$-coordinate of $C$ is then $x_C = b\cos\angle{BAC}$. From the referenced formulas (which are just an application of the Law of Cosines) we have $$\cos\angle{BAC} = {b^2+c^2-a^2 \over 2bc},$$ and by the Pythagorean theorem the $y$-coordinate of $C$ is $y_C = \pm\sqrt{b^2-x_C^2}$.

amd
  • 53,693
  • This was exactly what I was looking for. It seems like $y^2_{C}$ should be $y_{C}$ instead. Probably just a typo. – paaskus Oct 20 '17 at 00:27
  • Yeah, it’s a typo. I had originally written something more complex and neglected to remove the exponent when I simplified it. – amd Oct 20 '17 at 00:57