
Chapter 11
153
Using HP Instrument BASIC
Displaying Graphics
1
1
. Using
HP Instrument
2
. Cha
p
te
r T
itle
3
. Chap
te
r T
itle
4
. Chap
te
r T
itle
5. Chap
te
r T
itle
BASIC
Hard copy
You can produce hard copy output of graphics by use of the printing feature. Press the
START
key located under the
[Copy]
key.
Default setting
The default setting when the power is turned on is as follows.
•
MOVE 0,0
A sample graphics program
Here follows a simple example to draw a line on the graphics screen.
Drawing a straight line
The program below draws a straight line from the point (50, 200) to another (300, 200).
GCLEAR ! Initializes the graphics screen.
MOVE 50,200 ! Moves the pen to the point (50, 200).
DRAW 300,200 ! Draws a straight line to the point (300, 200).
END
Drawing a circle
Here follows an example of sub-program for drawing a circle. Giving coordinates of the
center and a radius to this sub-programs as arguments allows you to draw a circle.
Changing the start value and the end value of the parameter Theta in this sub-program
allows you to draw a circular arc too.
SUB Drawcircle(Centx,Centy,R) !
DEG ! Uses "°" has the unit of agnle.
X=Centx+R !
Y=Centy !
MOVE X,Y ! Moves the pen to the start point.
For Theta=1 to 360 !
X=INT(COS(Theta)*R+Centx) ! Calculates the x coordinate of a
point on the circle
Y=INT(SIN(Theta)*R+Centy) ! Calculates the y coordinate of a
point on the circle.
DRAW X,Y ! Draws a line to the point (X, Y)
NEXT Theta !
SUBEND !
Summary of Contents for 4294A
Page 4: ...4 ...
Page 18: ...18 Contents ...
Page 24: ...24 Chapter1 To make effective use of this manual Other manuals attached to this unit ...
Page 94: ...94 Chapter6 Reading Writing Measurement Data Reading Writing Data ...
Page 110: ...110 Chapter7 Processing Measurement Results Analyzing Measurement Results ...
Page 136: ...136 Chapter10 Handling Errors Sample program for error handling ...
Page 246: ...246 13 Application Sample Programs File Transfer Function ...
Page 254: ...254 Chapter15 Setting the Display LCD Sample program for setting the LCD screen ...
Page 507: ...Index Index 507 Index ...
Page 508: ...508 Index Index ...
Page 509: ...Index Index 509 Index ...
Page 510: ...510 Index Index ...
Page 511: ...Index Index 511 Index ...
Page 512: ...512 Index Index ...
Page 513: ...Index Index 513 Index ...
Page 514: ...514 Index Index ...
Page 515: ...Index Index 515 Index ...
Page 516: ...516 Index Index ...
Page 517: ...Index Index 517 Index ...
Page 518: ...518 Index Index ...