Post Reply 
Any RPN, No regs, line given 2 points
12-24-2017, 11:10 PM
Post: #5
RE: Any RPN, No regs, line given 2 points
(12-24-2017 12:58 PM)Mike (Stgt) Wrote:  Special version for HP41
Code:
01·LBL "2PT"
02 ST- Z    
03 RDN      
04 ST- Z    
05 RDN      
06 /        
07 *        
08 ST- Y    
09 X<> L    
10 END
The 'canonical' way by calculating Delta x and Delta y instead of -Delta x and -Delta y would be two bytes longer. So it is up to you to enter point two first - if you mind. (Results are the same either way. Wink )

Notes: to remember the sequence when entering the points just have in mind to match axis and register, x-value in register X, y-value in Y. So enter the y-value before the x-value for each point.
Output - slope in X, y-axis intercept in Y.

Ciao.....Mike

Very cool, yes, the extra stack operations available on the 41 are fabulous. I did want something I could use on various machines however, but thanks! Wink
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread



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