Post Reply 
(35S) Short Pythagorean Triangle Solver Formula
12-08-2014, 12:45 PM
Post: #2
RE: HP 35S: Short Pythagorean Triangle Solver Formula
(12-07-2014 09:43 AM)Gerald H Wrote:  Short Pythagorean triangle solver.

C is the hypotenuse of a right-angled triangle.

ABS( [ A , B ] ) = C

Indeed ABS is quite handy for calculating hypotenuses or diagonals of rectangles – I often use it with the [i] key: 3 [i] 4 [ABS] directly returns 5.

But in this case ABS is not the best solution since it has no direct inverse function. Therefore the 35s cannot use one of its most powerful features: solving equations symbolically. The solution and the solving time also depend on the initial guesses provided in X and registers A, B and C.

All this is avoided if the equation is implemented the classic way:

SQ(C) = SQ(A) + SQ(B)

In this case the 35s returns the solution immediately, regardless of the contents of the stack and the data registers. Try it – it's much faster because now the 35s "knows" that in your example B equals √(C² – A²). And it will not return negative results either. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 35S: Short Pythagorean Triangle Solver Formula - Dieter - 12-08-2014 12:45 PM



User(s) browsing this thread: 2 Guest(s)