Formula to bisect right angled triangle and calculate for perpendicular line

I'm in the midst of writing a module in Common Lisp 1 and I need to calculate the distance of a hypothetical  line projected perpendicularly from apex of the right angle of (various)  triangles to the opposite side.

I'm not the greatest at trig; I can calculate for a given triangle but I don't know the formula to actually bisect a triangle.

In the attached illustration, the distance I am trying to calculate is indicated by the green arrow. (L)

Information that I have:

1) Lengths of sides A, B and C

2) There will always be at least 1 right angle.

Information I can gather if necessary:

a) The two non-right angles.

b) The perimeter

II don't necessarily need any help with the actual code (Unless there's a Lisp function I'm unfamiliar with). What I'm after is the the generic geometric formula that will lead me to the information I'm after.

Any advice for me?

Thanks in advance


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wow it's been a while.. I think it's calculated like this

height = (2/c)*(SQRT(s*(s-a)*(s-b)*(s-c)))

where s = (A+B+C) / 2


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ynotrobitsAuthor Commented:
Well that did it...

Thank you

Usually I figure these things out by tinkering but I think the tinker route would have been a long road to hoe in this case.

Let me ask you this:

I'm assuming "C" will always be the hypotenuse. Are "A" and "B" interchangeable?
if I remember correct yes..

C is the side that the line is going to (or coming from, depending on how you're looking at it), and the other 2 sides are interchangeable.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Brian UtterbackPrinciple Software EngineerCommented:
I think that there is an easier way.

Consider that the hypotenuse (side C) of the triangle is always the longest side and that the right angle is always the opposite angle from that side.  We also know that the area of this triangle is simply one half times side A times side B. We also know that looking at the triangle, taking side C as the base, the area is likewise one half the base times the height and is equal to
the previous area we calculated. Furthermore, the height in this orientation is exactly the quantity we want, the length of the
green arrow.

Putting this together, we get:

Let X = Area of the triangle, let G=length of green arrow.

X = .5*A*B
X = .5*G*C

.5*A*B = .5*G*C
A*B = G*C
(A*B)/C = G

Therefore, the height of a right triangle resting on its hypotenuse is always the other two sides multiplied together divided
by the hypotenuse.
ynotrobitsAuthor Commented:
Thanks for the new formula. I'll try it out now.

I just completed the Lisp translation for MMDeveloper's formula so I thought I'd post it in case someone was searching Lisp:

(setq s (/( + a b c)2))

(setq TRI_HT (*(sqrt(*(*(*(- s a)s)(- s b))(- s c)))(/ 2.0 C)))
ynotrobitsAuthor Commented:
Yes indeed, that is simpler.

In Lisp:

(setq TRI_HT(/(* a b)c))

Just as an FYI, the purpose behind all of this is to impart information to a designer who is creating shapes for CNC operations.

This information will help in preventing the creation of a part that is too big to "nest" on a given slab size.

Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Math / Science

From novice to tech pro — start learning today.