; HP 42S RPN Function Plotter ; author Neil Franklin, last modification 2010.09.12 ; program stuff ; uses register 01 for loop counter PRGM ; function specific stuff LBL "SINE" ; draw a sine, can replace sine with anything else ; basic stuff, any function CLLCD ; blank space for drawing 1.131 ; display X coordinates run this range, 1 to 131 STO 01 ; use as loop counter for ISG LBL 01 ; loop target for GTO after ISG RCL 01 ; get X coordinate IP ; remove end value, to compute Y coordinate from it 1 ; shift to range 0 to 130 - 130 ; scale to range 0 to 1, for interface / ; function specific stuff 360 ; scale input to degrees range 0..360 x SIN ; do sine, gives -1 to +1 1 ; shift to range 0 to 2 + 2 ; scale to range 0 to 1, for interface / ; basic stuff, any function 15 ; scale to range 0 to 15 * 16 ; shift+mirror to range 16 (bottom) to 1 (top) x<>y - RCL 01 ; get X coordinate, together with existing Y IP ; remove end value, to plot X/Y PIXEL ; and draw it ISG 01 ; standard counted loop stuff GTO 01 PRGM ; display stays until <- is pressed to abort