Specifications

Revision C 16/01/96
Chapter 8 "HP-GL2" 53
DI - Absolute Direction
DI [
run
,
rise
] [;]
run : X direction component
rise : Y direction component
This command determines the direction in which subsequent labels will be printed.
rise
run
gives the tangent of the angle between the base line of a label's characters and the horizontal.
run is equivalent to cos θ and rise is equivalent to sin θ.
θ
run
rise
tan
θ=
cos
sin
θ
θ
Values for run and rise are clamped real numbers.
When you issue a DI instruction the carriage return point is set to the current pen location.
The instruction is ignored if run and rise are both 0.
Any text path that you set with the DV instruction will combine with the current printing direction to
determine the layout of characters on the page.
If you omit the parameters the printing direction is horizontal.
The label direction which is specified by this command is not affected by changes in the location of P1 and
P2.
10 ' -Absolute Direction -
20 WIDTH "LPT1:", 255
30 LPRINT CHR$(27); "E";
40 LPRINT CHR$(27); "%0B";
50 LPRINT "IN;SP1;";
60 DEG = -45
70 RAD = 3.1416 / 180 * DEG
80 LPRINT "IN;SP2;PA3050,4450;"
90 LPRINT "DT";"
100 LPRINT "DT0,2;LB_*_1988#"; "DI2,2;LB_*_1989#";
110 LPRINT "DT2,0;LB_*_1990#"; "DI2,-2;LB_*_1991#";
120 LPRINT "DT0,-2;LB_*_1992#"; "DI-2,-2;LB_*_1993#";
130 LPRINT "DT-2,0;LB_*_1994#"; "DI-2,2;LB_*_1995#";
140 LPRINT "PA3500,5350;DI", COS(0),SIN(0); "LB_*_2000"; CHR$(13); "#";
150 LPRINT "DI", COS(RAD); SIN(RAD); "LB_RETURN POINT"; CHR$(13); "#";
160 LPRINT CHR$(27); "%0A";
170 LPRINT CHR$(27); "E";
180 END
<sample 54>