Re: How to compute triangle base/altitude intersection



"Phlip" <phlipcpp@xxxxxxxxx> writes:

Balabek wrote:

Hope you can help me solve this problem.

Suppose I have a triange ABC. I have altitude passing through vertice
C, and it intersects line AB or extension of line AB at point D.

How do you define "altitude"? Is it "parallel to Oy"?
Or is it perpendicular to AB? Or something else?
What if AB is "altitude"? (The right word could be "vertical" by the way).


Given coordinates of points A, B, and lengths of line segments AC, BC,
how would you calculate coordinates of point D?

There are two solutions in general (there may be exactly 1 when ABC is
a degenerate triangle (on the same line or all three points
identical), and 0 when you give lengths AC CB too short).


I do have a way to compute it, but I just can't shake away this feeling
that it is not very efficient.

I can't shake the feeling that A> pythagorean theorem is required, and B>
you can solve it via only squares, not square roots.

But I could be wrong on any of those, so post your actual algorithm...

(And the best newsgroup might be news:comp.graphics.algorithms )


--
__Pascal Bourguignon__
.



Relevant Pages