/* balls.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" /* Common Block Declarations */ struct { real matrix[9] /* was [3][3] */, postrn[3], coords[3]; } matrix_; #define matrix_1 matrix_ /* Table of constant values */ static integer c__1 = 1; static integer c__9 = 9; static integer c__3 = 3; static integer c__4 = 4; /* Main program */ int MAIN__(void) { /* Initialized data */ static char defcol[60*7] = "COLOUR#######C################ 0.625 0.6" "25 0.625 1.70" "COLOUR#######N################ 0.125 0.12" "5 1.000 1.60" "COLOUR#######O################ 0.750 0.050" " 0.050 1.50" "COLOUR#######S################ 1.000 1.000 " " 0.025 1.85" "COLOUR#######H################ 1.000 1.000 " " 1.000 1.20" "COLOUR#######P################ 0.400 1.000 " "0.400 1.80" "COLOUR######################## 1.000 0.000 1" ".000 2.00"; /* Format strings */ static char fmt_120[] = "(\0021 0 0 0 input co-ordinate + radius trans" "formation\002/\0020 1 0 0\002/\0020 0 1 0\002/4f10.3)"; static char fmt_140[] = "(\0022\002,/,7(1x,f8.3))"; static char fmt_156[] = "(1x,a,3f8.2)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; icilist ici__1; /* Builtin functions */ integer s_cmp(char *, char *, ftnlen, ftnlen), s_wsfe(cilist *), do_fio( integer *, char *, ftnlen), e_wsfe(void), s_rsfe(cilist *), e_rsfe(void), s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), e_wsle(void); /* Subroutine */ int s_stop(char *, ftnlen); integer s_rsfi(icilist *), e_rsfi(void); /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen); /* Local variables */ static integer i__, j; static real x, y, z__, tx, ty, tz, rad, rgb[15000] /* was [3][5000] */; extern /* Subroutine */ int view_matrix__(void); static char card[80]; static integer icol, narg, iatm; static char mask[24*5000]; static integer ncol, natm; static real spam[2100000] /* was [7][300000] */; static char atom[80*300000]; static real xmid, ymid, zmid, xmin, ymin, xmax, ymax; static char test[24]; static real zmax, zmin; static logical hflag; extern integer iargc_(void); static real scale; extern logical match_(char *, char *, ftnlen, ftnlen); static char flags[80]; static real xspan, yspan, zspan, xroom, yroom, zroom; extern /* Subroutine */ int getarg_(integer *, char *, ftnlen); static real aspect, radius[5000]; /* Fortran I/O blocks */ static cilist io___7 = { 0, 6, 0, "(A,A)", 0 }; static cilist io___8 = { 0, 6, 0, "(A)", 0 }; static cilist io___9 = { 0, 6, 0, "(A)", 0 }; static cilist io___10 = { 0, 6, 0, "(A)", 0 }; static cilist io___11 = { 0, 6, 0, "(A)", 0 }; static cilist io___12 = { 0, 6, 0, "(A)", 0 }; static cilist io___13 = { 0, 6, 0, "(A)", 0 }; static cilist io___14 = { 0, 6, 0, "(A)", 0 }; static cilist io___15 = { 0, 6, 0, "(A)", 0 }; static cilist io___16 = { 0, 6, 0, "(A)", 0 }; static cilist io___17 = { 0, 6, 0, "(A)", 0 }; static cilist io___18 = { 0, 6, 0, "(A)", 0 }; static cilist io___22 = { 0, 5, 1, "(A80)", 0 }; static cilist io___24 = { 0, 0, 0, 0, 0 }; static icilist io___25 = { 0, card, 0, "(6X,A24,3F8.3,F6.2)", 80, 1 }; static cilist io___29 = { 0, 0, 0, 0, 0 }; static cilist io___31 = { 0, 0, 0, 0, 0 }; static cilist io___32 = { 0, 0, 0, 0, 0 }; static icilist io___42 = { 0, card, 0, "(30X,3F8.3)", 80, 1 }; static cilist io___48 = { 0, 0, 0, 0, 0 }; static cilist io___49 = { 0, 0, 0, 0, 0 }; static cilist io___63 = { 0, 6, 0, fmt_120, 0 }; static cilist io___64 = { 0, 6, 0, "(A)", 0 }; static cilist io___65 = { 0, 6, 0, "(A)", 0 }; static cilist io___66 = { 0, 6, 0, "(A)", 0 }; static cilist io___67 = { 0, 6, 0, "(A)", 0 }; static cilist io___68 = { 0, 6, 0, fmt_140, 0 }; static cilist io___69 = { 0, 0, 0, "(/)", 0 }; static cilist io___70 = { 0, 0, 0, fmt_156, 0 }; static cilist io___71 = { 0, 0, 0, fmt_156, 0 }; static cilist io___72 = { 0, 0, 0, fmt_156, 0 }; static cilist io___73 = { 0, 0, 0, fmt_156, 0 }; /* Program to set up input for RENDER */ /* This program takes a Brookhaven PDB-format file of atomic coordinates */ /* concatenated with a "colours" file that specifies the colouring and spherical */ /* radius of atoms according to atom type, residue type, or any other criterion, */ /* and produces a file that can be used directly as input to RENDER. */ /* Usage: cat colors.pdb protein.pdb | balls [-h] | render */ /* auxiliary files: setup.matrix optional file containing 3x3 view matrix */ /* setup.angles optional file defining view matrix */ /* in terms of 3 rotation angles */ /* I/O units for colour/co-ordinate input, specs output, user output */ /* Ethan Merritt Oct 1988 */ /* Modified to read in 3x3 view matrix (e.g. from CCP FRODO view command) */ /* from file setup.matrix. Matrix is applied before */ /* finding translation, center, and scale. Afterwards the input matrix */ /* to RENDER is therefore the identity matrix. */ /* Default to CPK colors and VDW radii */ /* L3: */ for (i__ = 1; i__ <= 3; ++i__) { for (j = 1; j <= 3; ++j) { matrix_1.matrix[i__ + j * 3 - 4] = 0.f; } matrix_1.matrix[i__ + i__ * 3 - 4] = 1.f; } view_matrix__(); /* Ethan Merritt Apr 1992 */ /* -h option suppresses header records in output */ hflag = FALSE_; narg = iargc_(); i__1 = narg; for (i__ = 1; i__ <= i__1; ++i__) { getarg_(&i__, flags, (ftnlen)80); if (s_cmp(flags, "-h", (ftnlen)2, (ftnlen)2) == 0) { hflag = TRUE_; } } if (! hflag) { s_wsfe(&io___7); do_fio(&c__1, "balls - Raster3D ", (ftnlen)17); do_fio(&c__1, "V2.7d ", (ftnlen)8); e_wsfe(); s_wsfe(&io___8); do_fio(&c__1, "80 64 tiles in x,y", (ftnlen)22); e_wsfe(); s_wsfe(&io___9); do_fio(&c__1, " 8 8 pixels (x,y) per tile", (ftnlen)31); e_wsfe(); s_wsfe(&io___10); do_fio(&c__1, "4 anti-aliasing 3x3 -> 2x2 pixels", (ftnlen)41) ; e_wsfe(); s_wsfe(&io___11); do_fio(&c__1, "0 0 0 black background", (ftnlen)26); e_wsfe(); s_wsfe(&io___12); do_fio(&c__1, "T yes, I LIKE shadows!", (ftnlen)30); e_wsfe(); s_wsfe(&io___13); do_fio(&c__1, "25 Phong power", (ftnlen)21); e_wsfe(); s_wsfe(&io___14); do_fio(&c__1, "0.15 secondary light contribution", (ftnlen)38); e_wsfe(); s_wsfe(&io___15); do_fio(&c__1, "0.05 ambient light contribution", (ftnlen)36); e_wsfe(); s_wsfe(&io___16); do_fio(&c__1, "0.25 specular reflection component", (ftnlen)39); e_wsfe(); s_wsfe(&io___17); do_fio(&c__1, "4.0 eye position", (ftnlen)22); e_wsfe(); s_wsfe(&io___18); do_fio(&c__1, "1 1 1 main light source position", (ftnlen)36); e_wsfe(); } aspect = 1.25f; ncol = 0; natm = 0; L10: i__1 = s_rsfe(&io___22); if (i__1 != 0) { goto L50; } i__1 = do_fio(&c__1, card, (ftnlen)80); if (i__1 != 0) { goto L50; } i__1 = e_rsfe(); if (i__1 != 0) { goto L50; } if (s_cmp(card, "COLO", (ftnlen)4, (ftnlen)4) == 0) { ++ncol; if (ncol > 5000) { s_wsle(&io___24); do_lio(&c__9, &c__1, "Colour table overflow. Increase ", (ftnlen) 33); do_lio(&c__9, &c__1, "MAXCOL and recompile.", (ftnlen)21); e_wsle(); s_stop("10", (ftnlen)2); } s_rsfi(&io___25); do_fio(&c__1, mask + (ncol - 1) * 24, (ftnlen)24); for (i__ = 1; i__ <= 3; ++i__) { do_fio(&c__1, (char *)&rgb[i__ + ncol * 3 - 4], (ftnlen)sizeof( real)); } do_fio(&c__1, (char *)&radius[ncol - 1], (ftnlen)sizeof(real)); e_rsfi(); } else if (s_cmp(card, "ATOM", (ftnlen)4, (ftnlen)4) == 0 || s_cmp(card, "HETA", (ftnlen)4, (ftnlen)4) == 0) { ++natm; if (natm > 300000) { s_wsle(&io___29); do_lio(&c__9, &c__1, "Atom array overflow. Increase ", (ftnlen) 31); do_lio(&c__9, &c__1, "MAXATM and recompile.", (ftnlen)21); e_wsle(); s_stop("20", (ftnlen)2); } s_copy(atom + (natm - 1) * 80, card, (ftnlen)80, (ftnlen)80); } else if (s_cmp(card, "END", (ftnlen)3, (ftnlen)3) == 0) { goto L50; } goto L10; /* Come here when EOF or 'END' record is reached */ L50: if (natm == 0) { s_wsle(&io___31); do_lio(&c__9, &c__1, "No atoms in input.", (ftnlen)18); e_wsle(); s_stop("30", (ftnlen)2); } /* Load default colors after any that were read in */ if (ncol < 4992) { for (i__ = 1; i__ <= 7; ++i__) { ++ncol; ici__1.icierr = 0; ici__1.iciend = 0; ici__1.icirnum = 1; ici__1.icirlen = 60; ici__1.iciunit = defcol + (i__ - 1) * 60; ici__1.icifmt = "(6X,A24,3F8.3,F6.2)"; s_rsfi(&ici__1); do_fio(&c__1, mask + (ncol - 1) * 24, (ftnlen)24); for (j = 1; j <= 3; ++j) { do_fio(&c__1, (char *)&rgb[j + ncol * 3 - 4], (ftnlen)sizeof( real)); } do_fio(&c__1, (char *)&radius[ncol - 1], (ftnlen)sizeof(real)); e_rsfi(); } } if (ncol == 0) { s_wsle(&io___32); do_lio(&c__9, &c__1, "No colours in input.", (ftnlen)20); e_wsle(); s_stop("40", (ftnlen)2); } xmax = -1e20f; xmin = 1e20f; ymax = -1e20f; ymin = 1e20f; zmax = -1e20f; zmin = 1e20f; i__1 = natm; for (iatm = 1; iatm <= i__1; ++iatm) { s_copy(card, atom + (iatm - 1) * 80, (ftnlen)80, (ftnlen)80); s_copy(test, card + 6, (ftnlen)24, (ftnlen)24); i__2 = ncol; for (icol = 1; icol <= i__2; ++icol) { if (match_(test, mask + (icol - 1) * 24, (ftnlen)24, (ftnlen)24)) { /* READ(CARD,'(30X,3F8.3)') X,Y,Z */ /* EAM Oct88 */ s_rsfi(&io___42); do_fio(&c__3, (char *)&matrix_1.coords[0], (ftnlen)sizeof( real)); e_rsfi(); x = matrix_1.coords[0] * matrix_1.matrix[0] + matrix_1.coords[ 1] * matrix_1.matrix[1] + matrix_1.coords[2] * matrix_1.matrix[2]; y = matrix_1.coords[0] * matrix_1.matrix[3] + matrix_1.coords[ 1] * matrix_1.matrix[4] + matrix_1.coords[2] * matrix_1.matrix[5]; z__ = matrix_1.coords[0] * matrix_1.matrix[6] + matrix_1.coords[1] * matrix_1.matrix[7] + matrix_1.coords[2] * matrix_1.matrix[8]; /* EAM Oct88 */ rad = radius[icol - 1]; spam[iatm * 7 - 7] = x; spam[iatm * 7 - 6] = y; spam[iatm * 7 - 5] = z__; spam[iatm * 7 - 4] = rad; spam[iatm * 7 - 3] = rgb[icol * 3 - 3]; spam[iatm * 7 - 2] = rgb[icol * 3 - 2]; spam[iatm * 7 - 1] = rgb[icol * 3 - 1]; /* Computing MAX */ r__1 = xmax, r__2 = x + rad; xmax = dmax(r__1,r__2); /* Computing MIN */ r__1 = xmin, r__2 = x - rad; xmin = dmin(r__1,r__2); /* Computing MAX */ r__1 = ymax, r__2 = y + rad; ymax = dmax(r__1,r__2); /* Computing MIN */ r__1 = ymin, r__2 = y - rad; ymin = dmin(r__1,r__2); /* Computing MAX */ r__1 = zmax, r__2 = z__ + rad; zmax = dmax(r__1,r__2); /* Computing MIN */ r__1 = zmin, r__2 = z__ - rad; zmin = dmin(r__1,r__2); goto L100; } /* L80: */ } s_wsle(&io___48); do_lio(&c__9, &c__1, "No colour table mask matches this atom:", ( ftnlen)39); e_wsle(); s_wsle(&io___49); do_lio(&c__9, &c__1, atom + (iatm - 1) * 80, (ftnlen)80); e_wsle(); s_stop("90", (ftnlen)2); L100: ; } xmid = (xmax + xmin) / 2.f; ymid = (ymax + ymin) / 2.f; zmid = (zmax + zmin) / 2.f; tx = -xmid; ty = -ymid; tz = -zmid; if (aspect >= 1.f) { /* The X direction is wider than the Y */ xroom = aspect; yroom = 1.f; zroom = 2.f; } else { xroom = 1.f; yroom = aspect; zroom = 2.f; } xspan = xmax - xmin; yspan = ymax - ymin; zspan = zmax - zmin; /* Computing MAX */ r__1 = xspan / xroom, r__2 = yspan / yroom, r__1 = max(r__1,r__2), r__2 = zspan / zroom; scale = dmax(r__1,r__2); /* Leave a little extra room as a border: */ scale /= .9f; if (! hflag) { s_wsfe(&io___63); do_fio(&c__1, (char *)&tx, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ty, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&tz, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&scale, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___64); do_fio(&c__1, "3 mixed object types", (ftnlen)28); e_wsfe(); s_wsfe(&io___65); do_fio(&c__1, "*", (ftnlen)1); e_wsfe(); s_wsfe(&io___66); do_fio(&c__1, "*", (ftnlen)1); e_wsfe(); s_wsfe(&io___67); do_fio(&c__1, "*", (ftnlen)1); e_wsfe(); } i__1 = natm; for (iatm = 1; iatm <= i__1; ++iatm) { spam[iatm * 7 - 7] += matrix_1.postrn[0]; spam[iatm * 7 - 6] += matrix_1.postrn[1]; spam[iatm * 7 - 5] += matrix_1.postrn[2]; s_wsfe(&io___68); for (i__ = 1; i__ <= 7; ++i__) { do_fio(&c__1, (char *)&spam[i__ + iatm * 7 - 8], (ftnlen)sizeof( real)); } e_wsfe(); /* L150: */ } s_wsfe(&io___69); e_wsfe(); s_wsfe(&io___70); do_fio(&c__1, "X min max:", (ftnlen)11); do_fio(&c__1, (char *)&xmin, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&xmax, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___71); do_fio(&c__1, "Y min max:", (ftnlen)11); do_fio(&c__1, (char *)&ymin, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ymax, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___72); do_fio(&c__1, "Z min max:", (ftnlen)11); do_fio(&c__1, (char *)&zmin, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&zmax, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___73); do_fio(&c__1, " scale:", (ftnlen)11); do_fio(&c__1, (char *)&scale, (ftnlen)sizeof(real)); e_wsfe(); return 0; } /* MAIN__ */ logical match_(char *subj, char *mask, ftnlen subj_len, ftnlen mask_len) { /* System generated locals */ logical ret_val; /* Local variables */ static integer i__; ret_val = FALSE_; for (i__ = 1; i__ <= 24; ++i__) { if (*(unsigned char *)&subj[i__ - 1] != *(unsigned char *)&mask[i__ - 1] && *(unsigned char *)&mask[i__ - 1] != '#') { return ret_val; } /* L10: */ } ret_val = TRUE_; return ret_val; } /* match_ */ /* Subroutine */ int view_matrix__(void) { /* Format strings */ static char fmt_3[] = "(/a,a)"; static char fmt_2[] = "(1x,\002 phiZ =\002,f8.2,\002 phiY =\002,f8" ".2,\002 phiX =\002,f8.2)"; static char fmt_4[] = "(1x,\002 tranX =\002,f8.2,\002 tranY =\002,f8" ".2,\002 tranZ =\002,f8.2)"; /* System generated locals */ integer i__1; real r__1, r__2, r__3; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(olist *), s_rsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), e_rsle(void), s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void), f_clos(cllist *); double atan2(doublereal, doublereal), cos(doublereal), sin(doublereal); integer s_wsle(cilist *), e_wsle(void); /* Local variables */ static integer i__, j; static real cx, cy, cz, sx, sy, sz, det, phix, phiy, phiz; /* Fortran I/O blocks */ static cilist io___75 = { 0, 3, 0, 0, 0 }; static cilist io___78 = { 0, 0, 0, "(1x,3f9.5)", 0 }; static cilist io___80 = { 0, 0, 0, "(' determinant =',f8.3)", 0 }; static cilist io___84 = { 0, 0, 0, fmt_3, 0 }; static cilist io___85 = { 0, 0, 0, fmt_2, 0 }; static cilist io___86 = { 0, 3, 0, 0, 0 }; static cilist io___87 = { 1, 3, 1, 0, 0 }; static cilist io___88 = { 0, 0, 0, fmt_2, 0 }; static cilist io___89 = { 0, 0, 0, fmt_4, 0 }; static cilist io___96 = { 0, 0, 0, fmt_3, 0 }; static cilist io___97 = { 0, 0, 0, "(1x,3f9.5)", 0 }; static cilist io___98 = { 0, 0, 0, 0, 0 }; matrix_1.postrn[0] = 0.f; matrix_1.postrn[1] = 0.f; matrix_1.postrn[2] = 0.f; o__1.oerr = 1; o__1.ounit = 3; o__1.ofnmlen = 12; o__1.ofnm = "setup.matrix"; o__1.orl = 0; o__1.osta = "OLD"; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; i__1 = f_open(&o__1); if (i__1 != 0) { goto L100; } s_rsle(&io___75); for (j = 1; j <= 3; ++j) { for (i__ = 1; i__ <= 3; ++i__) { do_lio(&c__4, &c__1, (char *)&matrix_1.matrix[i__ + j * 3 - 4], ( ftnlen)sizeof(real)); } } e_rsle(); s_wsfe(&io___78); for (j = 1; j <= 3; ++j) { for (i__ = 1; i__ <= 3; ++i__) { do_fio(&c__1, (char *)&matrix_1.matrix[i__ + j * 3 - 4], (ftnlen) sizeof(real)); } } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 3; cl__1.csta = 0; f_clos(&cl__1); det = matrix_1.matrix[0] * matrix_1.matrix[4] * matrix_1.matrix[8] + matrix_1.matrix[3] * matrix_1.matrix[7] * matrix_1.matrix[2] + matrix_1.matrix[1] * matrix_1.matrix[5] * matrix_1.matrix[6] - matrix_1.matrix[6] * matrix_1.matrix[4] * matrix_1.matrix[2] - matrix_1.matrix[3] * matrix_1.matrix[1] * matrix_1.matrix[8] - matrix_1.matrix[0] * matrix_1.matrix[7] * matrix_1.matrix[5]; s_wsfe(&io___80); do_fio(&c__1, (char *)&det, (ftnlen)sizeof(real)); e_wsfe(); phix = atan2(-matrix_1.matrix[5], matrix_1.matrix[8]); phiy = atan2(matrix_1.matrix[2], matrix_1.matrix[8] / cos(phix)); phiz = atan2(-matrix_1.matrix[1], matrix_1.matrix[0]); s_wsfe(&io___84); do_fio(&c__1, " View Angles from matrix", (ftnlen)24); do_fio(&c__1, " ", (ftnlen)1); e_wsfe(); s_wsfe(&io___85); r__1 = phiz * 57.295778666661661f; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); r__2 = phiy * 57.295778666661661f; do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real)); r__3 = phix * 57.295778666661661f; do_fio(&c__1, (char *)&r__3, (ftnlen)sizeof(real)); e_wsfe(); return 0; L100: o__1.oerr = 1; o__1.ounit = 3; o__1.ofnmlen = 12; o__1.ofnm = "setup.angles"; o__1.orl = 0; o__1.osta = "OLD"; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; i__1 = f_open(&o__1); if (i__1 != 0) { goto L200; } s_rsle(&io___86); do_lio(&c__4, &c__1, (char *)&phiz, (ftnlen)sizeof(real)); do_lio(&c__4, &c__1, (char *)&phiy, (ftnlen)sizeof(real)); do_lio(&c__4, &c__1, (char *)&phix, (ftnlen)sizeof(real)); e_rsle(); i__1 = s_rsle(&io___87); if (i__1 != 0) { goto L101; } i__1 = do_lio(&c__4, &c__1, (char *)&matrix_1.postrn[0], (ftnlen)sizeof( real)); if (i__1 != 0) { goto L101; } i__1 = do_lio(&c__4, &c__1, (char *)&matrix_1.postrn[1], (ftnlen)sizeof( real)); if (i__1 != 0) { goto L101; } i__1 = do_lio(&c__4, &c__1, (char *)&matrix_1.postrn[2], (ftnlen)sizeof( real)); if (i__1 != 0) { goto L101; } i__1 = e_rsle(); if (i__1 != 0) { goto L101; } L101: cl__1.cerr = 0; cl__1.cunit = 3; cl__1.csta = 0; f_clos(&cl__1); s_wsfe(&io___88); do_fio(&c__1, (char *)&phiz, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&phiy, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&phix, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___89); do_fio(&c__1, (char *)&matrix_1.postrn[0], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&matrix_1.postrn[1], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&matrix_1.postrn[2], (ftnlen)sizeof(real)); e_wsfe(); cx = cos(phix / 57.295778666661661f); sx = sin(phix / 57.295778666661661f); cy = cos(phiy / 57.295778666661661f); sy = sin(phiy / 57.295778666661661f); cz = cos(phiz / 57.295778666661661f); sz = sin(phiz / 57.295778666661661f); matrix_1.matrix[0] = cz * cy; matrix_1.matrix[3] = sz * cx + cz * sy * sx; matrix_1.matrix[6] = sz * sx - cz * sy * cx; matrix_1.matrix[1] = -sz * cy; matrix_1.matrix[4] = cz * cx - sx * sy * sz; matrix_1.matrix[7] = cz * sx + sz * sy * cx; matrix_1.matrix[2] = sy; matrix_1.matrix[5] = -sx * cy; matrix_1.matrix[8] = cx * cy; s_wsfe(&io___96); do_fio(&c__1, " View Matrix from angles", (ftnlen)24); do_fio(&c__1, " ", (ftnlen)1); e_wsfe(); s_wsfe(&io___97); for (j = 1; j <= 3; ++j) { for (i__ = 1; i__ <= 3; ++i__) { do_fio(&c__1, (char *)&matrix_1.matrix[i__ + j * 3 - 4], (ftnlen) sizeof(real)); } } e_wsfe(); return 0; L200: s_wsle(&io___98); do_lio(&c__9, &c__1, " No view matrix or angles provided", (ftnlen)34); e_wsle(); return 0; } /* view_matrix__ */ /* Main program alias */ int balls_ () { MAIN__ (); return 0; }