Вы находитесь на странице: 1из 1

; file DrawSineWave.

txt
;
;
;
;
;
;

This RPN calculator program plots the sine wave


given by:
y = sin ( x )
starting from x = 0 degrees and continuing forever
at subsequent integer values of x. Hence this
program requires no passed parameters.

;
;
;
;
;

Because this program continues to add data points to the


cGraph window forever it will eventually overflow the
number of data points which the cGraph window can accept
(nothing bad happens, the cGraph window merely forces
the RPN calculator program to halt).

LBL 0
ClearG ; empty any prior plot
DEG
; sets calculator into degrees mode for trig functions
+0.
; initial x axis value
STO 0
LBL 1
RCL 0
sin
RCL 0
SumG
+1.
STO+ 0
GTO 1

;
;
;
;
;

we return here for each new data point


recall x axis value
y = sin(x)
prepare for SumG statement by setting X = x, Y = y
add new point to graph

; increment x

Вам также может понравиться