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
00002
00003
00004
00005
00006 #include "f2c.h"
00007
00008
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 int phline_(real *x1, real *y1, real *x2, real *y2)
00021 {
00022
00023 real r__1, r__2;
00024
00025
00026 static real xleft;
00027 static integer id;
00028 static real dx1, dy1, dx2, dy2, dx3, dy3;
00029 extern int zzphph_(real *, real *, real *, real *);
00030 static real fac, xyl;
00031
00032
00033
00034
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
00051 r__1 = dx2 - dx1;
00052
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 }
00083