Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdarr.F
CommitLineData
fe4da5cc 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)
13C.
14C. ******************************************************************
15C. * *
16C. * Draw a segment from (X1,Y1) to (X2,Y2) *
17C. * and an arrow (of size SIZE) at the ending point (X2,Y2) *
18C. * together with the one-character text ITEXT *
19C. * *
20C. * ==>Called by : GDAXIS *
21C. * Author : P.Zanarini ********* *
22C. * *
23C. ******************************************************************
24C.
25 DIMENSION U(3),V(3)
26 CHARACTER*(*) ITEXT
27 SAVE TGAR
28 DATA TGAR/0.6/
29C.
30C. ------------------------------------------------------------------
31C.
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)
37C
38C If axis size is too small, then return without drawing it
39C
40 IF (XL.LE.0.1) GO TO 999
41C
42C Draw the segment
43C
44 CALL GDRAWV(U,V,2)
45C
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
54C
55C Draw the arrow
56C
57 CALL GDRAWV(U,V,3)
58C
59 X0=X1+(XL+2*SIZE)*FCOS
60 Y0=Y1+(XL+2*SIZE)*FSIN
61 ANGLE=0.0
62 LWIDTH=1
63 IOPT=0
64C
65C Draw the text
66C
67 CALL GDRAWT(X0,Y0,ITEXT,SIZE,ANGLE,LWIDTH,IOPT)
68C
69 999 RETURN
70 END