0
$\begingroup$

If we assume that s1(x)=s2(x) (the areas of the two triangles are equal) and and we know (x1, y1), (x2, y2), (x3, y3)and also we assume that the line L which is between (x1, y1) and (x, y(x)), because we know for example another point in this line so we know the slope and the line. How can I find x value in ? Is there an easy way to find x?

enter image description here

https://stackoverflow.com/questions/12830146/two-intersecting-triangle-in-r

  • 0
    @ben: OK. You may not like it!2012-10-11

1 Answers 1

1

If we know the slope of the line $\ell$ through the known point $(x_3,y_3)$ and the (unknown) point $(x,y_{(x)})$, then we can find an equation for that line, say $ax+by+c=0$.

Now we can use the formula for the distance of a point from a line to find the distances $d_1$ and $d_2$ from $(x_1,y_1)$ and $(x_2,y_2)$ to $\ell$. These are given by $d_i=\frac{|ax_i+by_i+c|}{\sqrt{a^2+b^2}}.$ So we know the heights of the little triangle and the big one. The little one has unknown base $b_1$. The big one has known base $b_2$. For we can find the coordinates you labelled $(x^\ast(x), y^\ast(x))$, the common vertex of the two triangles. This is done by finding the intersection point of the line $\ell$ and the line through $(x_1,y_1)$ and $(x_2,y_2)$. Once we know the intersection point, we can compute $b_2$.

By the equality of areas, we have $b_1d_1=b_2d_2.$ so since we know the $d_i$ and $b_2$, we know $b_1$. Finally, we find the point on $\ell$ which is distance $b_1$ from the known point $(x^\ast(x),y^\ast(x))$. Since we know the equation $ax+by+c=0$ of $\ell$, this is not hard. We want to find where the circle with centre the known point $(x^\ast(x),y^\ast(x)$ and radius the known $b_1$ meets the line with equation $ax+by=c$.

By substitution, we end up with a quadratic equation in $x$. There are in general two solutions. The right one can be picked out fairly easily. Or else we can write the equation of $\ell$ parametrically. Then the appropriate value of the parameter can be obtained from the fact that $b_1d_1=b_2d_2$.