1 /*  -- translated by f2c (version 20100827).
2    You must link the resulting object file with libf2c:
3 	on Microsoft Windows system, link with libf2c.lib;
4 	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 	or, if you install libf2c.a in a standard place, with -lf2c -lm
6 	-- in that order, at the end of the command line, as in
7 		cc *.o -lf2c -lm
8 	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9 
10 		http://www.netlib.org/f2c/libf2c.zip
11 */
12 
13 #include "libtinyf2c.h"
14 
15 /* Table of constant values */
16 
17 static integer c__1 = 1;
18 
19 /* ----------------------------------------------------------------------- */
20 /*     UGUNIT */
21 /* ----------------------------------------------------------------------- */
22 /*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved. */
23 /* ----------------------------------------------------------------------- */
ugunit_(void)24 /* Subroutine */ int ugunit_(void)
25 {
26     static real vx1, vx2, vy1, vy2, uvx1, uvx2, uvy1, uvy2;
27     static integer index;
28     static real vxoff, vyoff, xfact2, yfact2, rundef;
29     extern /* Subroutine */ int ugiget_(char *, integer *, ftnlen), szlacl_(
30 	    void), ugrget_(char *, real *, ftnlen), szlaop_(integer *,
31 	    integer *), ugrset_(char *, real *, ftnlen);
32     static real vxuloc, vyuloc;
33     extern /* Subroutine */ int sgqvpt_(real *, real *, real *, real *),
34 	    szlazv_(real *, real *, real *, real *);
35     static real uxunit, vxunit, uyunit, vyunit;
36 
37 /*     / GET INTERNAL PARAMETERES / */
38     ugrget_("RUNDEF", &rundef, (ftnlen)6);
39     ugiget_("INDEX", &index, (ftnlen)5);
40 /*     / INQUIRE NORMALIZATION TRANSFORMATION / */
41     sgqvpt_(&vx1, &vx2, &vy1, &vy2);
42 /*     / DETERMINE LOCATION OF UNIT VECTORS IN NDC / */
43     ugrget_("VXULOC", &vxuloc, (ftnlen)6);
44     if (vxuloc == rundef) {
45 	ugrget_("VXUOFF", &vxoff, (ftnlen)6);
46 	vxuloc = vx2 + vxoff;
47 	ugrset_("VXULOC", &vxuloc, (ftnlen)6);
48     }
49     ugrget_("VYULOC", &vyuloc, (ftnlen)6);
50     if (vyuloc == rundef) {
51 	ugrget_("VYUOFF", &vyoff, (ftnlen)6);
52 	vyuloc = vy1 + vyoff;
53 	ugrset_("VYULOC", &vyuloc, (ftnlen)6);
54     }
55 /*     / DETERMINE LENGTH OF UNIT VECTORS IN NDC / */
56     ugrget_("UXUNIT", &uxunit, (ftnlen)6);
57     ugrget_("XFACT2", &xfact2, (ftnlen)6);
58     if (uxunit == rundef) {
59 	ugrget_("VXUNIT", &vxunit, (ftnlen)6);
60 	uxunit = vxunit / xfact2;
61 	ugrset_("UXUNIT", &uxunit, (ftnlen)6);
62     } else {
63 	vxunit = uxunit * xfact2;
64 	ugrset_("VXUNIT", &vxunit, (ftnlen)6);
65     }
66     ugrget_("UYUNIT", &uyunit, (ftnlen)6);
67     ugrget_("YFACT2", &yfact2, (ftnlen)6);
68     if (uyunit == rundef) {
69 	ugrget_("VYUNIT", &vyunit, (ftnlen)6);
70 	uyunit = vyunit / yfact2;
71 	ugrset_("UYUNIT", &uyunit, (ftnlen)6);
72     } else {
73 	vyunit = uyunit * yfact2;
74 	ugrset_("VYUNIT", &vyunit, (ftnlen)6);
75     }
76 /*     / DRAW UNIT VECTORS / */
77     uvx1 = vxuloc;
78     uvx2 = vxuloc + vxunit;
79     uvy1 = vyuloc;
80     uvy2 = vyuloc + vyunit;
81     szlaop_(&c__1, &index);
82     szlazv_(&uvx1, &uvy1, &uvx2, &uvy1);
83     szlazv_(&uvx1, &uvy1, &uvx1, &uvy2);
84     szlacl_();
85     return 0;
86 } /* ugunit_ */
87 
88