This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdarr.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:20  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.25  by  S.Giani
11 *-- Author :
12       SUBROUTINE GDARR(X1,Y1,X2,Y2,SIZE,ITEXT)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Draw a segment from (X1,Y1) to (X2,Y2)                   *
17 C.    *       and an arrow (of size SIZE) at the ending point (X2,Y2)  *
18 C.    *       together with the one-character text ITEXT               *
19 C.    *                                                                *
20 C.    *    ==>Called by : GDAXIS                                       *
21 C.    *       Author : P.Zanarini   *********                          *
22 C.    *                                                                *
23 C.    ******************************************************************
24 C.
25       DIMENSION U(3),V(3)
26       CHARACTER*(*) ITEXT
27       SAVE TGAR
28       DATA TGAR/0.6/
29 C.
30 C.    ------------------------------------------------------------------
31 C.
32       U(1)=X1
33       U(2)=X2
34       V(1)=Y1
35       V(2)=Y2
36       XL=SQRT((X2-X1)**2+(Y2-Y1)**2)
37 C
38 C             If axis size is too small, then return without drawing it
39 C
40       IF (XL.LE.0.1) GO TO 999
41 C
42 C             Draw the segment
43 C
44       CALL GDRAWV(U,V,2)
45 C
46       FSIN=(Y2-Y1)/XL
47       FCOS=(X2-X1)/XL
48       U(1)=X1+(XL-SIZE)*FCOS-SIZE*TGAR*FSIN
49       U(3)=X1+(XL-SIZE)*FCOS+SIZE*TGAR*FSIN
50       V(1)=Y1+(XL-SIZE)*FSIN+SIZE*TGAR*FCOS
51       V(3)=Y1+(XL-SIZE)*FSIN-SIZE*TGAR*FCOS
52       U(2)=X2
53       V(2)=Y2
54 C
55 C             Draw the arrow
56 C
57       CALL GDRAWV(U,V,3)
58 C
59       X0=X1+(XL+2*SIZE)*FCOS
60       Y0=Y1+(XL+2*SIZE)*FSIN
61       ANGLE=0.0
62       LWIDTH=1
63       IOPT=0
64 C
65 C             Draw the text
66 C
67       CALL GDRAWT(X0,Y0,ITEXT,SIZE,ANGLE,LWIDTH,IOPT)
68 C
69   999 RETURN
70       END