aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/gks/gqchup.x
blob: 3f12d8c4a64a4762468b4e4300a2aeddfeeadd76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<gset.h>
include	"gks.h"

# GQCHUP -- Inquire character up vector.

procedure gqchup (ierror, chupx, chupy)

int	ierror			# Error code; ierror = 0 for no error 
real	chupx, chupy		# Character up vector x and y components

int	angle
real	txup
int	gstati()
include	"gks.com"

begin
	if (gk_std == NULL) {
	    # GKS not in proper state; no active workstations
	    ierror = 7
	    chupx = 0.0
	    chupy = 0.0
	    return
	} else
	    ierror = 0

	iferr {
	    angle = gstati (gp[gk_std], G_TXUP) 

	    txup = real (angle) * 3.1415926 / 180.
	    chupx = cos (txup)
	    chupy = sin (txup)
	} then {
	    ierror = 1
	    chupx = 0.0
	    chupy = 0.0
	}
end