home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 June B
/
Pcwk6b98.iso
/
DESIGCAD
/
DESCAD7P
/
DCAD
/
BASICCAD
/
BEARING.BSC
next >
Wrap
Text File
|
1994-07-28
|
1KB
|
56 lines
'BEARING.BSC
'This basicCAD file measures bearings in DesignCAD for Windows
'User sets two points to be measured; this program calculates the
'distance and bearing and places them in a text string at the same angle
'which the user can place as he wishes
txa=sys(13)
ns$="N"
ew$="E"
a=0
a2=0
a3=0
a4=0
>Presetpoint 2
Setpoint "mark ends of bearing line:" 2
pointval x1 y1 1
Pointval x2 y2 2
sys(1)=0
dist = sqrt(sqr(x2-x1) + sqr(y2-y1))
a=angle(x2-x1, y2-y1)
if (a > 180) then ns$="S"
if ((a > 90) and (a < 270)) then ew$="W"
if ((a >= 0) and (a <= 90)) then a2 = 90 - a
if ((a > 90) and (a <= 180)) then a2 = a - 90
if ((a > 180) and (a < 270)) then a2 = 270 - a
if ((a >= 270) and (a <= 360)) then a2 = a - 270
a3=60*(a2-int(a2))
a4=60*(a3-int(a3))
precision 0
a2$=int(a2)
a3$=int(a3)
precision 1
a4$=a4
ang$=ns$+a2$+chr$(176)+a3$+chr$(39)+a4$+chr$(34)+ew$
precision 3
dist$=dist
t$=ang$," ",dist$
if ((a < 270) and (a > 90)) then
sys(13) = a-180
else
sys(13)=a
end if
>text 0,[t$]
sys(13) = txa
t$=""
end