What is the simplest way to calculate the distance between the 'top' point of two triangles, when they share the same base? The available information is the side lengths of both triangles, and ideally I'd avoid calculating the coordinates of the taller triangle altogether.
An example is at: https://www.desmos.com/calculator/4tu2dghalr , where I'm interested in determining the length of the orange line CD. Point D can be either inside or outside the taller triangle.
So far I've tried:
- Calculating the area of both triangles using Heron's formula based on the perimeters (all sides are known). From that, I can get the heights of both triangles, but no further.
- By hand/calculator I can use the cosine rule to, one-by-one, work out all the interior angles and ultimately form either triangle ACD or BCD, and solving for side DC again with the cosine rule. This is not ideal in my case because I'd like to do this programmatically and avoid having to decide which triangle to climb to get to CD, because the calculations will be vectorised over many, many
As context, these two triangles sit within three circles. Two circles centred at A and B have a third circle centred at C that is touching both circles, all have known radius. I'd like to calculate whether point D is in the circle surrounding C or not, by determining whether the distance CD is smaller than the radius of circle C.