Jump to content
  • Advertisement
Sign in to follow this  
jvkao

Smallest triangle containing point

This topic is 3235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Easy one this, I think. Very difficult to search online for, however. Given the triangle HAB, how can I find the smallest triangle HCD that contains point FG? The image shown above is the optimal triangle HCD. Note that the slope of CD must be equal to the slope of AB. Informally, the problem is essentially "scale HAB just enough to contain FG without modifying the 'shape' of the triangle".

Share this post


Link to post
Share on other sites
Advertisement
It seems simple, but that makes me think I must be misunderstanding part of the problem :)

Anyway, it seems to me that the solution would go something like this:

1. Compute a normal vector perpendicular to AB.

2. Compute the perpendicular distance from H to AB.

3. Project GF onto this normal. This is the perpendicular distance from H to CD.

4. You now know the perpendicular distance from H to both AB and CD. This should give you enough information to compute C and D using some simple trig.

But again, maybe I'm missing something...

Share this post


Link to post
Share on other sites
It most likely is that simple, thanks for the description.

I don't quite understand step 3 however (why it works).

Share this post


Link to post
Share on other sites
If I'm understanding the question correctly...


1) Get vector H->FG
2) Compute angles between H->FG and H->A and H->B
3) You now have the near side of both HD(FG) and HC(FG) as well as the angle between the hypotenuse of each and the near side, which is sufficient to calculate the final lengths of hypotenuses(?) HD and HC.

EDIT: Corrected misnaming of tri sides. :-)

Share this post


Link to post
Share on other sites
I'm an idiot.

The solution was incredibly simple but I didn't see it for some reason.

Thanks very much, both of you.

Share this post


Link to post
Share on other sites
This probably doesn't add much, but the way I would have solved this is just taking the parallel to AB that passes through "FG" (a pretty bad name for a point, by the way). Its intersections with AH and BH are C and D.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!