I'm a programmer and I came across a math problem in my current project that I can't figure out.

My situation looks like this.

enter image description here

Everything in black is known or I know how to figure out.

  • A and B are the two lines of which their equations are known.
  • h is the length of the side between the two lines
  • w is the width of the triangle
  • I is the point where the two lines intersect

And I want to figure out the value of w

It's worth mentioning that my triangle can be any kind of triangle, not just isosceles.


Let's call your two equations $f(x)=Ax+B$ (the upper one) and $g(x)=Cx+D$.

For exactly the right $x=x_h$ they are $h$ apart. We then have $$f(x_h)-h=g(x_h)$$ from which $x_h$ can be isolated.

At their intercept, with $x=x_I$ we have $f(x_I)=g(x_I)$, from which we can isolate $x_I$.

Then $$x_I-x_h=w$$

  • $\begingroup$ How do I go about finding the other side lengths? $\endgroup$ – SpaceFace Mar 9 '16 at 19:43
  • $\begingroup$ @SpaceFace Do you know the $x$-position of the line $h$? $\endgroup$ – Bobson Dugnutt Mar 9 '16 at 19:51
  • $\begingroup$ No, that's essentially what I'm trying to figure out. $\endgroup$ – SpaceFace Mar 9 '16 at 19:55
  • $\begingroup$ @SpaceFace See my new answer; was this what you were looking for? $\endgroup$ – Bobson Dugnutt Mar 9 '16 at 20:02
  • $\begingroup$ Yeah, I actually just came up with the same thing on my own a few moments ago, I might give my own answer with a bit more detall, but I'll mark this. $\endgroup$ – SpaceFace Mar 9 '16 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.