Algorithm for a geometry-problem

104 Views Asked by At

In a system I'm building I'd like to have a "point" that hangs from two wires. The length of these wires is variable.

So basically I would have a triangle, two sides of which are "varible".

Could you give any hints on what to read/ how to build an algorithm that is given x,y coordinates of the point that is between the two sides of the triangles, and that could be used to calculate the two lengths of the sides.

1

There are 1 best solutions below

5
On BEST ANSWER

let the two rigid points be at $(0,0)$ and $(1,0)$, and let the hanging point be at $(x,y)$, with $x,y<0$. Then the distance from the hanging point to the two rigid points is:

$\sqrt{x^2+y^2}$

and:

$\sqrt{(x-1)^2+y^2}$

Note that this might very well not necesarily give you the length of the wires: assume one wire has length 1, and the other has length 1000. then surely the point is simply hanging below one of the rigid points (at distance 1), but we cannot compute the length of the second wire based just on the location of the hanging point.