Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

phline.c

Go to the documentation of this file.
00001 /* phline.f -- translated by f2c (version 19961017).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 
00008 /* Common Block Declarations */
00009 
00010 extern struct {
00011     integer ndash;
00012     real xldash[8], xid;
00013 } zzdash_;
00014 
00015 #define zzdash_1 zzdash_
00016 
00017 
00018 
00019 
00020 /* Subroutine */ int phline_(real *x1, real *y1, real *x2, real *y2)
00021 {
00022     /* System generated locals */
00023     real r__1, r__2;
00024 
00025     /* Local variables */
00026     static real xleft;
00027     static integer id;
00028     static real dx1, dy1, dx2, dy2, dx3, dy3;
00029     extern /* Subroutine */ int zzphph_(real *, real *, real *, real *);
00030     static real fac, xyl;
00031 
00032 
00033 /*  Draw a dashed line between 2 internal coordinate points; */
00034 /*  replaces old PHLINE, which is now renamed ZZPHPH */
00035 
00036 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00037  */
00038 
00039     dx1 = *x1;
00040     dy1 = *y1;
00041     dx2 = *x2;
00042     dy2 = *y2;
00043 
00044     if (zzdash_1.ndash <= 1) {
00045         zzphph_(&dx1, &dy1, &dx2, &dy2);
00046         goto L9000;
00047     }
00048 
00049 L100:
00050 /* Computing 2nd power */
00051     r__1 = dx2 - dx1;
00052 /* Computing 2nd power */
00053     r__2 = dy2 - dy1;
00054     xyl = sqrt(r__1 * r__1 + r__2 * r__2);
00055     if (xyl <= 1e-5f) {
00056         goto L9000;
00057     }
00058     id = (integer) zzdash_1.xid + 1;
00059     xleft = (id - zzdash_1.xid) * (r__1 = zzdash_1.xldash[id - 1], dabs(r__1))
00060             ;
00061     if (xyl <= xleft) {
00062         if (zzdash_1.xldash[id - 1] > 0.f) {
00063             zzphph_(&dx1, &dy1, &dx2, &dy2);
00064         }
00065         zzdash_1.xid += xyl / (r__1 = zzdash_1.xldash[id - 1], dabs(r__1));
00066         goto L9000;
00067     } else {
00068         fac = xleft / xyl;
00069         dx3 = dx1 + fac * (dx2 - dx1);
00070         dy3 = dy1 + fac * (dy2 - dy1);
00071         if (zzdash_1.xldash[id - 1] > 0.f) {
00072             zzphph_(&dx1, &dy1, &dx3, &dy3);
00073         }
00074         dx1 = dx3;
00075         dy1 = dy3;
00076         zzdash_1.xid = (real) (id % zzdash_1.ndash);
00077         goto L100;
00078     }
00079 
00080 L9000:
00081     return 0;
00082 } /* phline_ */
00083 
 

Powered by Plone

This site conforms to the following standards: