home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume24 / gnuplot3 / part05 < prev    next >
Encoding:
Text File  |  1991-10-26  |  48.3 KB  |  1,555 lines

  1. Newsgroups: comp.sources.misc
  2. From: gershon%gr@cs.utah.edu (Elber Gershon)
  3. Subject:  v24i027:  gnuplot3 - interactive function plotting utility, Part05/26
  4. Message-ID: <1991Oct26.222257.6369@sparky.imd.sterling.com>
  5. X-Md4-Signature: afb83635085983cbd4979dcbadb73bd6
  6. Date: Sat, 26 Oct 1991 22:22:57 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
  10. Posting-number: Volume 24, Issue 27
  11. Archive-name: gnuplot3/part05
  12. Environment: UNIX, MS-DOS, VMS
  13. Supersedes: gnuplot2: Volume 11, Issue 65-79
  14.  
  15. #!/bin/sh
  16. # this is Part.05 (part 5 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file gnuplot/contour.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 5; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping gnuplot/contour.c'
  34. else
  35. echo 'x - continuing file gnuplot/contour.c'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/contour.c' &&
  37. X                            "contour cntr_struct");
  38. X    p_cntr -> X = p_edge -> vertex[1] -> X * t +
  39. X             p_edge -> vertex[0] -> X * (1-t);
  40. X    p_cntr -> Y = p_edge -> vertex[1] -> Y * t +
  41. X             p_edge -> vertex[0] -> Y * (1-t);
  42. X    return p_cntr;
  43. X    }
  44. }
  45. X
  46. /*
  47. X * Simple routine to decide if two real values are equal by simply
  48. X * calculating the relative/absolute error between them (< EPSILON).
  49. X */
  50. static int fuzzy_equal(x, y)
  51. double x, y;
  52. {
  53. X    if (abs(x) > EPSILON)            /* Calculate relative error: */
  54. X        return (abs((x - y) / x) < EPSILON);
  55. X    else                    /* Calculate absolute error: */
  56. X    return (abs(x - y) < EPSILON);
  57. }
  58. X
  59. /*
  60. X * Generate the triangles.
  61. X * Returns the lists (vrtxs edges & polys) via pointers to their heads.
  62. X */
  63. static void gen_triangle(num_isolines, iso_lines, p_polys, p_edges,
  64. X    p_vrts, x_min, y_min, z_min, x_max, y_max, z_max)
  65. int num_isolines;
  66. struct iso_curve *iso_lines;
  67. struct poly_struct **p_polys;
  68. struct edge_struct **p_edges;
  69. struct vrtx_struct **p_vrts;
  70. double *x_min, *y_min, *z_min, *x_max, *y_max, *z_max;
  71. {
  72. X    int i, grid_x_max = iso_lines->p_count;
  73. X    struct vrtx_struct *p_vrtx1, *p_vrtx2, *pv_temp;
  74. X    struct edge_struct *p_edge1, *p_edge2, *pe_tail1, *pe_tail2, *pe_temp,
  75. X              *p_edge_middle, *pe_m_tail;
  76. X    struct poly_struct *p_poly, *pp_tail;
  77. X
  78. X    *p_polys = NULL;
  79. X    *p_edges = NULL;
  80. X    *p_vrts = NULL;
  81. X    *z_min = INFINITY;
  82. X    *y_min = INFINITY;
  83. X    *x_min = INFINITY;
  84. X    *z_max = -INFINITY;
  85. X    *y_max = -INFINITY;
  86. X    *x_max = -INFINITY;
  87. X
  88. X    /* Read 1st row. */
  89. X    p_vrtx1 = gen_vertices(grid_x_max, iso_lines->points,
  90. X               x_min, y_min, z_min, x_max, y_max, z_max);
  91. X    *p_vrts = p_vrtx1;
  92. X    /* Gen. its edges.*/
  93. X    pe_temp = p_edge1 = gen_edges(grid_x_max, p_vrtx1, &pe_tail1);
  94. X    for (i = 1; i < grid_x_max; i++) {/* Mark one side of edges as boundary. */
  95. X    pe_temp -> poly[1] = NULL;
  96. X    pe_temp = pe_temp -> next;
  97. X    }
  98. X    for (i = 1; i < num_isolines; i++) { /* Read next column and gen. polys. */
  99. X    iso_lines = iso_lines->next;
  100. X        /* Get row into list. */
  101. X        p_vrtx2 = gen_vertices(grid_x_max, iso_lines->points,
  102. X                   x_min, y_min, z_min, x_max, y_max, z_max);
  103. X        /* Generate its edges. */
  104. X        p_edge2 = gen_edges(grid_x_max, p_vrtx2, &pe_tail2);
  105. X    /* Generate edges from one vertex list to the other one: */
  106. X    p_edge_middle = gen_edges_middle(grid_x_max, p_vrtx1, p_vrtx2,
  107. X                                 &pe_m_tail);
  108. X
  109. X    /* Now we can generate the polygons themselves (triangles). */
  110. X    p_poly = gen_polys(grid_x_max, p_edge1, p_edge_middle, p_edge2,
  111. X                                 &pp_tail);
  112. X        pe_tail1 -> next = (*p_edges);      /* Chain new edges to main list. */
  113. X        pe_m_tail -> next = p_edge1;
  114. X    *p_edges = p_edge_middle;
  115. X    pe_tail1 = pe_tail2;
  116. X    p_edge1 = p_edge2;
  117. X
  118. X    pv_temp = p_vrtx2;
  119. X    while (pv_temp -> next) pv_temp = pv_temp -> next;
  120. X    pv_temp -> next = *p_vrts;
  121. X    *p_vrts = p_vrtx1 = p_vrtx2;
  122. X
  123. X        pp_tail -> next = (*p_polys);       /* Chain new polys to main list. */
  124. X    *p_polys = p_poly;
  125. X    }
  126. X
  127. X    pe_temp = p_edge1;
  128. X    for (i = 1; i < grid_x_max; i++) {/* Mark one side of edges as boundary. */
  129. X    pe_temp -> poly[0] = NULL;
  130. X    pe_temp = pe_temp -> next;
  131. X    }
  132. X
  133. X    pe_tail1 -> next = (*p_edges);    /* Chain last edges list to main list. */
  134. X    *p_edges = p_edge1;
  135. X
  136. X    /* Update the boundary flag, saved in each edge, and update indexes: */
  137. X    pe_temp = (*p_edges);
  138. X    i = 1;
  139. X
  140. X    while (pe_temp) {
  141. X    pe_temp -> boundary = (!(pe_temp -> poly[0])) ||
  142. X                  (!(pe_temp -> poly[1]));
  143. X    pe_temp = pe_temp -> next;
  144. X    }
  145. }
  146. X
  147. /*
  148. X * Handles grid_x_max 3D points (One row) and generate linked list for them.
  149. X */
  150. static struct vrtx_struct *gen_vertices(grid_x_max, points,
  151. X                      x_min, y_min, z_min, x_max, y_max, z_max)
  152. int grid_x_max;
  153. struct coordinate *points;
  154. double *x_min, *y_min, *z_min, *x_max, *y_max, *z_max;
  155. {
  156. X    int i;
  157. X    struct vrtx_struct *p_vrtx, *pv_tail, *pv_temp;
  158. X
  159. X    for (i=0; i<grid_x_max; i++) {/* Get a point and generate the structure. */
  160. X        pv_temp = (struct vrtx_struct *) alloc(sizeof(struct vrtx_struct),
  161. X                        "contour vertex");
  162. X    pv_temp -> X = points[i].x;
  163. X    pv_temp -> Y = points[i].y;
  164. X    pv_temp -> Z = points[i].z;
  165. X
  166. X    if (pv_temp -> X > *x_max) *x_max = pv_temp -> X; /* Update min/max. */
  167. X    if (pv_temp -> Y > *y_max) *y_max = pv_temp -> Y;
  168. X    if (pv_temp -> Z > *z_max) *z_max = pv_temp -> Z;
  169. X    if (pv_temp -> X < *x_min) *x_min = pv_temp -> X;
  170. X    if (pv_temp -> Y < *y_min) *y_min = pv_temp -> Y;
  171. X    if (pv_temp -> Z < *z_min) *z_min = pv_temp -> Z;
  172. X
  173. X    if (i == 0)                              /* First vertex in row: */
  174. X        p_vrtx = pv_tail = pv_temp;
  175. X    else {
  176. X        pv_tail -> next = pv_temp;   /* Stick new record as last one. */
  177. X        pv_tail = pv_tail -> next;    /* And continue to last record. */
  178. X    }
  179. X    }
  180. X    pv_tail -> next = NULL;
  181. X
  182. X    return p_vrtx;
  183. }
  184. X
  185. /*
  186. X * Combines N vertices in pair to form N-1 edges.
  187. X * Returns pointer to the edge list (pe_tail will point on last edge in list).
  188. X */
  189. static struct edge_struct *gen_edges(grid_x_max, p_vrtx, pe_tail)
  190. int grid_x_max;
  191. struct vrtx_struct *p_vrtx;
  192. struct edge_struct **pe_tail;
  193. {
  194. X    int i;
  195. X    struct edge_struct *p_edge, *pe_temp;
  196. X
  197. X    for (i=0; i<grid_x_max-1; i++) {         /* Generate grid_x_max-1 edges: */
  198. X    pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
  199. X                        "contour edge");
  200. X    pe_temp -> vertex[0] = p_vrtx;              /* First vertex of edge. */
  201. X    p_vrtx = p_vrtx -> next;                     /* Skip to next vertex. */
  202. X    pe_temp -> vertex[1] = p_vrtx;             /* Second vertex of edge. */
  203. X        if (i == 0)                                    /* First edge in row: */
  204. X        p_edge = (*pe_tail) = pe_temp;
  205. X    else {
  206. X        (*pe_tail) -> next = pe_temp;   /* Stick new record as last one. */
  207. X        *pe_tail = (*pe_tail) -> next;   /* And continue to last record. */
  208. X     }
  209. X    }
  210. X    (*pe_tail) -> next = NULL;
  211. X
  212. X    return p_edge;
  213. }
  214. X
  215. /*
  216. X * Combines 2 lists of N vertices each into edge list:
  217. X * The dots (.) are the vertices list, and the              .  .  .  .
  218. X *  edges generated are alternations of vertical edges      |\ |\ |\ |
  219. X *  (|) and diagonal ones (\).                              | \| \| \|
  220. X *  A pointer to edge list (alternate | , \) is returned    .  .  .  .
  221. X * Note this list will have (2*grid_x_max-1) edges (pe_tail points on last
  222. X * record).
  223. X */
  224. static struct edge_struct *gen_edges_middle(grid_x_max, p_vrtx1, p_vrtx2,
  225. X                                pe_tail)
  226. int grid_x_max;
  227. struct vrtx_struct *p_vrtx1, *p_vrtx2;
  228. struct edge_struct **pe_tail;
  229. {
  230. X    int i;
  231. X    struct edge_struct *p_edge, *pe_temp;
  232. X
  233. X    /* Gen first (|). */
  234. X    pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
  235. X                            "contour edge");
  236. X    pe_temp -> vertex[0] = p_vrtx2;                 /* First vertex of edge. */
  237. X    pe_temp -> vertex[1] = p_vrtx1;                /* Second vertex of edge. */
  238. X    p_edge = (*pe_tail) = pe_temp;
  239. X
  240. X    /* Advance in vrtx list grid_x_max-1 times, and gen. 2 edges /| for each.*/
  241. X    for (i=0; i<grid_x_max-1; i++) {
  242. X    /* The / edge. */
  243. X    pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
  244. X                            "contour edge");
  245. X    pe_temp -> vertex[0] = p_vrtx1;             /* First vertex of edge. */
  246. X    pe_temp -> vertex[1] = p_vrtx2 -> next;    /* Second vertex of edge. */
  247. X        (*pe_tail) -> next = pe_temp;       /* Stick new record as last one. */
  248. X    *pe_tail = (*pe_tail) -> next;       /* And continue to last record. */
  249. X
  250. X    /* The | edge. */
  251. X    pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
  252. X                            "contour edge");
  253. X    pe_temp -> vertex[0] = p_vrtx2 -> next;     /* First vertex of edge. */
  254. X    pe_temp -> vertex[1] = p_vrtx1 -> next;    /* Second vertex of edge. */
  255. X        (*pe_tail) -> next = pe_temp;       /* Stick new record as last one. */
  256. X    *pe_tail = (*pe_tail) -> next;       /* And continue to last record. */
  257. X
  258. X        p_vrtx1 = p_vrtx1 -> next;   /* Skip to next vertices in both lists. */
  259. X        p_vrtx2 = p_vrtx2 -> next;
  260. X    }
  261. X    (*pe_tail) -> next = NULL;
  262. X
  263. X    return p_edge;
  264. }
  265. X
  266. /*
  267. X * Combines 3 lists of edges into triangles:
  268. X * 1. p_edge1: Top horizontal edge list:        -----------------------
  269. X * 2. p_edge_middge: middle edge list:         |\  |\  |\  |\  |\  |\  |
  270. X *                                             |  \|  \|  \|  \|  \|  \|
  271. X * 3. p_edge2: Bottom horizontal edge list:     -----------------------
  272. X * Note that p_edge1/2 lists has grid_x_max-1 edges, while p_edge_middle has
  273. X * (2*grid_x_max-1) edges.
  274. X * The routine simple scans the two list    Upper 1         Lower
  275. X * and generate two triangle upper one        ----         | \
  276. X * and lower one from the lists:             0\   |2      0|   \1
  277. X * (Nums. are edges order in polys)             \ |         ----
  278. X * The routine returns a pointer to a                         2
  279. X * polygon list (pp_tail points on last polygon).          1
  280. X *                                                   -----------
  281. X * In addition, the edge lists are updated -        | \   0     |
  282. X * each edge has two pointers on the two            |   \       |
  283. X * (one active if boundary) polygons which         0|1   0\1   0|1
  284. X * uses it. These two pointer to polygons           |       \   |
  285. X * are named: poly[0], poly[1]. The diagram         |    1    \ |
  286. X * on the right show how they are used for the       -----------
  287. X * upper and lower polygons.                             0
  288. X */
  289. static struct poly_struct *gen_polys(grid_x_max, p_edge1, p_edge_middle,
  290. X                            p_edge2, pp_tail)
  291. int grid_x_max;
  292. struct edge_struct *p_edge1, *p_edge_middle, *p_edge2;
  293. struct poly_struct **pp_tail;
  294. {
  295. X    int i;
  296. X    struct poly_struct *p_poly, *pp_temp;
  297. X
  298. X    p_edge_middle -> poly[0] = NULL;                /* Its boundary! */
  299. X
  300. X    /* Advance in vrtx list grid_x_max-1 times, and gen. 2 polys for each. */
  301. X    for (i=0; i<grid_x_max-1; i++) {
  302. X    /* The Upper. */
  303. X    pp_temp = (struct poly_struct *) alloc(sizeof(struct poly_struct),
  304. X                            "contour poly");
  305. X    /* Now update polys about its edges, and edges about the polygon. */
  306. X    pp_temp -> edge[0] = p_edge_middle -> next;
  307. X    p_edge_middle -> next -> poly[1] = pp_temp;
  308. X    pp_temp -> edge[1] = p_edge1;
  309. X    p_edge1 -> poly[0] = pp_temp;
  310. X    pp_temp -> edge[2] = p_edge_middle -> next -> next;
  311. X    p_edge_middle -> next -> next -> poly[0] = pp_temp;
  312. X    if (i == 0)                   /* Its first one in list: */
  313. X        p_poly = (*pp_tail) = pp_temp;
  314. X    else {
  315. X        (*pp_tail) -> next = pp_temp;
  316. X        *pp_tail = (*pp_tail) -> next;
  317. X    }
  318. X
  319. X    /* The Lower. */
  320. X    pp_temp = (struct poly_struct *) alloc(sizeof(struct poly_struct),
  321. X                            "contour poly");
  322. X    /* Now update polys about its edges, and edges about the polygon. */
  323. X    pp_temp -> edge[0] = p_edge_middle;
  324. X    p_edge_middle -> poly[1] = pp_temp;
  325. X    pp_temp -> edge[1] = p_edge_middle -> next;
  326. X    p_edge_middle -> next -> poly[0] = pp_temp;
  327. X    pp_temp -> edge[2] = p_edge2;
  328. X    p_edge2 -> poly[1] = pp_temp;
  329. X    (*pp_tail) -> next = pp_temp;
  330. X    *pp_tail = (*pp_tail) -> next;
  331. X
  332. X        p_edge1 = p_edge1 -> next;
  333. X        p_edge2 = p_edge2 -> next;
  334. X        p_edge_middle = p_edge_middle -> next -> next;
  335. X    }
  336. X    p_edge_middle -> poly[1] = NULL;                /* Its boundary! */
  337. X    (*pp_tail) -> next = NULL;
  338. X
  339. X    return p_poly;
  340. }
  341. X
  342. /*
  343. X * Calls the (hopefully) desired interpolation/approximation routine.
  344. X */
  345. static void put_contour(p_cntr, z_level, x_min, x_max, y_min, y_max, contr_kind)
  346. struct cntr_struct *p_cntr;
  347. double z_level, x_min, x_max, y_min, y_max;
  348. int contr_kind;
  349. {
  350. X    if (!p_cntr) return;            /* Nothing to do if it is empty contour. */
  351. X
  352. X    switch (interp_kind) {
  353. X    case INTERP_NOTHING:              /* No interpolation/approximation. */
  354. X        put_contour_nothing(p_cntr);
  355. X        break;
  356. X    case INTERP_CUBIC:                    /* Cubic spline interpolation. */
  357. X        put_contour_cubic(p_cntr, z_level, x_min, x_max, y_min, y_max,
  358. X                                contr_kind);
  359. X        break;
  360. X    case APPROX_BSPLINE:                       /* Bspline approximation. */
  361. X        put_contour_bspline(p_cntr, z_level, x_min, x_max, y_min, y_max,
  362. X                                    contr_kind);
  363. X        break;
  364. X    }
  365. X
  366. X    free_contour(p_cntr);
  367. }
  368. X
  369. /*
  370. X * Simply puts contour coordinates in order with no interpolation or
  371. X * approximation.
  372. X */
  373. static put_contour_nothing(p_cntr)
  374. struct cntr_struct *p_cntr;
  375. {
  376. X    while (p_cntr) {
  377. X    add_cntr_point(p_cntr -> X, p_cntr -> Y);
  378. X    p_cntr = p_cntr -> next;
  379. X    }
  380. X    end_crnt_cntr();
  381. }
  382. X
  383. /*
  384. X * Find Complete Cubic Spline Interpolation.
  385. X */
  386. static put_contour_cubic(p_cntr, z_level, x_min, x_max, y_min, y_max,
  387. X                                 contr_kind)
  388. struct cntr_struct *p_cntr;
  389. double z_level, x_min, x_max, y_min, y_max;
  390. int contr_kind;
  391. {
  392. X    int num_pts, i;
  393. X    double tx1, ty1, tx2, ty2;                    /* Tangents at end points. */
  394. X    struct cntr_struct *pc_temp;
  395. X
  396. X    num_pts = count_contour(p_cntr);         /* Number of points in contour. */
  397. X
  398. X    if (num_pts > 2) {  /* Take into account 3 points in tangent estimation. */
  399. X    calc_tangent(3, p_cntr -> X, p_cntr -> next -> X,
  400. X            p_cntr -> next -> next -> X,
  401. X            p_cntr -> Y, p_cntr -> next -> Y,
  402. X            p_cntr -> next -> next -> Y, &tx1, &ty1);
  403. X    pc_temp = p_cntr;
  404. X    for (i=3; i<num_pts; i++) pc_temp = pc_temp -> next;/* Go to the end.*/
  405. X    calc_tangent(3, pc_temp -> next -> next -> X,
  406. X             pc_temp -> next -> X, pc_temp -> X,
  407. X            pc_temp -> next -> next -> Y,
  408. X            pc_temp -> next -> Y, pc_temp -> Y, &tx2, &ty2);
  409. X        tx2 = (-tx2);   /* Inverse the vector as we need opposite direction. */
  410. X        ty2 = (-ty2);
  411. X    }
  412. X    /* If following (num_pts > 1) is TRUE then exactly 2 points in contour.  */
  413. X    else if (num_pts > 1) {/* Take into account 2 points in tangent estimat. */
  414. X    calc_tangent(2, p_cntr -> X, p_cntr -> next -> X, 0.0,
  415. X            p_cntr -> Y, p_cntr -> next -> Y, 0.0, &tx1, &ty1);
  416. X    calc_tangent(2, p_cntr -> next -> X, p_cntr -> X, 0.0,
  417. X            p_cntr -> next -> Y, p_cntr -> Y, 0.0, &tx2, &ty2);
  418. X        tx2 = (-tx2);   /* Inverse the vector as we need opposite direction. */
  419. X        ty2 = (-ty2);
  420. X    }
  421. X    else return;            /* Only one point (???) - ignore it. */
  422. X
  423. X    switch (contr_kind) {
  424. X    case OPEN_CONTOUR:
  425. X        break;
  426. X    case CLOSED_CONTOUR:
  427. X        tx1 = tx2 = (tx1 + tx2) / 2.0;         /* Make tangents equal. */
  428. X        ty1 = ty2 = (ty1 + ty2) / 2.0;
  429. X        break;
  430. X    }
  431. X    complete_spline_interp(p_cntr, num_pts, 0.0, 1.0, tx1, ty1, tx2, ty2);
  432. X    end_crnt_cntr();
  433. }
  434. X
  435. /*
  436. X * Find Bspline approximation for this data set.
  437. X * Uses global variable num_approx_pts to determine number of samples per
  438. X * interval, where the knot vector intervals are assumed to be uniform, and
  439. X * Global variable bspline_order for the order of Bspline to use.
  440. X */
  441. static put_contour_bspline(p_cntr, z_level, x_min, x_max, y_min, y_max,
  442. X                                contr_kind)
  443. struct cntr_struct *p_cntr;
  444. double z_level, x_min, x_max,  y_min, y_max;
  445. int contr_kind;
  446. {
  447. X    int num_pts, i, order = bspline_order;
  448. X    struct cntr_struct *pc_temp;
  449. X
  450. X    num_pts = count_contour(p_cntr);         /* Number of points in contour. */
  451. X    if (num_pts < 2) return;     /* Cannt do nothing if empty or one points! */
  452. X    /* Order must be less than number of points in curve - fix it if needed. */
  453. X    if (order > num_pts - 1) order = num_pts - 1;
  454. X
  455. X    gen_bspline_approx(p_cntr, num_pts, order, contr_kind);
  456. X    end_crnt_cntr();
  457. }
  458. X
  459. /*
  460. X * Estimate the tangents according to the n last points where n might be
  461. X * 2 or 3 (if 2 onlt x1, x2).
  462. X */
  463. static calc_tangent(n, x1, x2, x3, y1, y2, y3, tx, ty)
  464. int n;
  465. double x1, x2, x3, y1, y2, y3, *tx, *ty;
  466. {
  467. X    double v1[2], v2[2], v1_magnitude, v2_magnitude;
  468. X
  469. X    switch (n) {
  470. X    case 2:
  471. X        *tx = (x2 - x1) * 0.3;
  472. X        *ty = (y2 - y1) * 0.3;
  473. X        break;
  474. X    case 3:
  475. X        v1[0] = x2 - x1;   v1[1] = y2 - y1;
  476. X        v2[0] = x3 - x2;   v2[1] = y3 - y2;
  477. X        v1_magnitude = sqrt(sqr(v1[0]) + sqr(v1[1]));
  478. X        v2_magnitude = sqrt(sqr(v2[0]) + sqr(v2[1]));
  479. X        *tx = (v1[0] / v1_magnitude) - (v2[0] / v2_magnitude) * 0.1;
  480. X        *tx *= v1_magnitude * 0.1;  /* Make tangent less than magnitude. */
  481. X        *ty = (v1[1] / v1_magnitude) - (v2[1] / v2_magnitude) * 0.1;
  482. X        *ty *= v1_magnitude * 0.1;  /* Make tangent less than magnitude. */
  483. X        break;
  484. X    default:                       /* Should not happen! */
  485. X        (*ty) = 0.1;
  486. X        *tx = 0.1;
  487. X        break;
  488. X    }
  489. }
  490. X
  491. /*
  492. X * Free all elements in the contour list.
  493. X */
  494. static void free_contour(p_cntr)
  495. struct cntr_struct *p_cntr;
  496. {
  497. X    struct cntr_struct *pc_temp;
  498. X
  499. X    while (p_cntr) {
  500. X    pc_temp = p_cntr;
  501. X    p_cntr = p_cntr -> next;
  502. X    free((char *) pc_temp);
  503. X    }
  504. }
  505. X
  506. /*
  507. X * Counts number of points in contour.
  508. X */
  509. static int count_contour(p_cntr)
  510. struct cntr_struct *p_cntr;
  511. {
  512. X    int count = 0;
  513. X
  514. X    while (p_cntr) {
  515. X    count++;
  516. X    p_cntr = p_cntr -> next;
  517. X    }
  518. X    return count;
  519. }
  520. X
  521. /*
  522. X * Interpolate given point list (defined via p_cntr) using Complete
  523. X * Spline interpolation.
  524. X */
  525. static complete_spline_interp(p_cntr, n, t_min, t_max, tx1, ty1, tx2, ty2)
  526. struct cntr_struct *p_cntr;
  527. int n;
  528. double t_min, t_max, tx1, ty1, tx2, ty2;
  529. {
  530. X    double dt, *tangents_x, *tangents_y;
  531. X    int i;
  532. X
  533. X    tangents_x = (double *) alloc((unsigned) (sizeof(double) * n),
  534. X                        "contour c_s_intr");
  535. X    tangents_y = (double *) alloc((unsigned) (sizeof(double) * n),
  536. X                        "contour c_s_intr");
  537. X
  538. X    if (n > 1) prepare_spline_interp(tangents_x, tangents_y, p_cntr, n,
  539. X                    t_min, t_max, tx1, ty1, tx2, ty2);
  540. X    else {
  541. X    free((char *) tangents_x);
  542. X    free((char *) tangents_y);
  543. X    return;
  544. X    }
  545. X
  546. X    dt = (t_max-t_min)/(n-1);
  547. X
  548. X    add_cntr_point(p_cntr -> X, p_cntr -> Y);           /* First point. */
  549. X
  550. X    for (i=0; i<n-1; i++) {
  551. X        hermit_interp(p_cntr -> X, p_cntr -> Y,
  552. X                     tangents_x[i], tangents_y[i],
  553. X             p_cntr -> next -> X, p_cntr -> next -> Y,
  554. X                     tangents_x[i+1], tangents_y[i+1], dt);
  555. X
  556. X        p_cntr = p_cntr -> next;
  557. X    }
  558. X
  559. X    free((char *) tangents_x);
  560. X    free((char *) tangents_y);
  561. }
  562. X
  563. /*
  564. X * Routine to calculate intermidiate value of the Hermit Blending function:
  565. X * This routine should be called only ONCE at the beginning of the program.
  566. X */
  567. static calc_hermit_table()
  568. {
  569. X    int i;
  570. X    double t, dt;
  571. X
  572. X    hermit_table = (table_entry *) alloc ((unsigned) (sizeof(table_entry) *
  573. X                        (num_approx_pts + 1)),
  574. X                        "contour hermit table");
  575. X    t = 0;
  576. X    dt = 1.0/num_approx_pts;
  577. X    for (i=0; i<=num_approx_pts; i++) {
  578. X        hermit_table[i][0] = (t-1)*(t-1)*(2*t+1);             /* h00. */
  579. X        hermit_table[i][1] = t*t*(-2*t+3);                 /* h10. */
  580. X        hermit_table[i][2] = t*(t-1)*(t-1);                 /* h01. */
  581. X        hermit_table[i][3] = t*t*(t-1);                     /* h11. */
  582. X        t = t + dt;
  583. X    }
  584. }
  585. X
  586. /*
  587. X * Routine to generate an hermit interpolation between two points given as
  588. X * two InterpStruct structures. Assume hermit_table is already calculated.
  589. X * Currently the points generated are printed to stdout as two reals (X, Y).
  590. X */
  591. static hermit_interp(x1, y1, tx1, ty1, x2, y2, tx2, ty2, dt)
  592. double x1, y1, tx1, ty1, x2, y2, tx2, ty2, dt;
  593. {
  594. X    int i;
  595. X    double x, y, vec_size, tang_size;
  596. X
  597. X    tx1 *= dt;  ty1 *= dt; /* Normalize the tangents according to param. t.  */
  598. X    tx2 *= dt;  ty2 *= dt;
  599. X
  600. X    /* Normalize the tangents so that their magnitude will be 1/3 of the     */
  601. X    /* segment length. This tumb rule guaranteed no cusps or loops!          */
  602. X    /* Note that this normalization keeps continuity to be G1 (but not C1).  */
  603. X    vec_size = sqrt(sqr(x1 - x2) + sqr(y2 - y1));
  604. X    tang_size = sqrt(sqr(tx1) + sqr(ty1));                  /* Normalize T1. */
  605. X    if (tang_size * 3 > vec_size) {
  606. X    tx1 *= vec_size / (tang_size * 3);
  607. X    ty1 *= vec_size / (tang_size * 3);
  608. X    }
  609. X    tang_size = sqrt(sqr(tx2) + sqr(ty2));                  /* Normalize T2. */
  610. X    if (tang_size * 3 > vec_size) {
  611. X    tx2 *= vec_size / (tang_size * 3);
  612. X    ty2 *= vec_size / (tang_size * 3);
  613. X    }
  614. X
  615. X    for (i=1; i<=num_approx_pts; i++) {      /* Note we start from 1 - first */
  616. X        x = hermit_table[i][0] * x1 +       /* point is not printed as it is */
  617. X            hermit_table[i][1] * x2 +   /* redundent (last on last section). */
  618. X            hermit_table[i][2] * tx1 +
  619. X            hermit_table[i][3] * tx2;
  620. X        y = hermit_table[i][0] * y1 +
  621. X            hermit_table[i][1] * y2 +
  622. X            hermit_table[i][2] * ty1 +
  623. X            hermit_table[i][3] * ty2;
  624. X    add_cntr_point(x, y);
  625. X    }
  626. }
  627. X
  628. /*
  629. X * Routine to Set up the 3*N mat for solve_tri_diag routine used in the
  630. X * Complete Spline Interpolation. Returns TRUE of calc O.K.
  631. X * Gets the points list in p_cntr (Of length n) and with tangent vectors tx1,
  632. X * ty1 at starting point and tx2, ty2 and end point.
  633. X */
  634. static prepare_spline_interp(tangents_x, tangents_y, p_cntr, n, t_min, t_max,
  635. X               tx1, ty1, tx2, ty2)
  636. double tangents_x[], tangents_y[];
  637. struct cntr_struct *p_cntr;
  638. int n;
  639. double t_min, t_max, tx1, ty1, tx2, ty2;
  640. {
  641. X    int i;
  642. X    double *r, t, dt;
  643. X    tri_diag *m;           /* The tri-diagonal matrix is saved here. */
  644. X    struct cntr_struct *p;
  645. X
  646. X    m = (tri_diag *) alloc((unsigned) (sizeof(tri_diag) * n),
  647. X                        "contour tri_diag");
  648. X    r = (double *) alloc((unsigned) (sizeof(double) * n),
  649. X                        "contour tri_diag2");
  650. X    n--;
  651. X
  652. X    p = p_cntr;
  653. X    m[0][0] = 0.0;    m[0][1] = 1.0;    m[0][2] = 0.0;
  654. X    m[n][0] = 0.0;    m[n][1] = 1.0;    m[n][2] = 0.0;
  655. X    r[0] = tx1;                           /* Set start tangent. */
  656. X    r[n] = tx2;                         /* Set end tangent. */
  657. X    t = t_min;
  658. X    dt = (t_max-t_min)/n;
  659. X    for (i=1; i<n; i++) {
  660. X       t = t + dt;
  661. X       m[i][0] = dt;
  662. X       m[i][2] = dt;
  663. X       m[i][1] = 2 * (m[i][0] + m[i][2]);
  664. X       r[i] = m[i][0] * ((p -> next -> X) - (p -> X)) / m[i][2]
  665. X            + m[i][2] * ((p -> next -> next -> X) - 
  666. X                         (p -> next -> X)) / m[i][0];
  667. X       r[i] *= 3.0;
  668. X       p = p -> next;
  669. X    }
  670. X
  671. X    if (!solve_tri_diag(m, r, tangents_x, n+1)) { /* Find the X(t) tangents. */
  672. X        free((char *) m);
  673. X        free((char *) r);
  674. X    int_error("Cannt interpolate X using complete splines", NO_CARET);
  675. X    }
  676. X
  677. X    p = p_cntr;
  678. X    m[0][0] = 0.0;    m[0][1] = 1.0;    m[0][2] = 0.0;
  679. X    m[n][0] = 0.0;    m[n][1] = 1.0;    m[n][2] = 0.0;
  680. X    r[0] = ty1;                           /* Set start tangent. */
  681. X    r[n] = ty2;                         /* Set end tangent. */
  682. X    t = t_min;
  683. X    dt = (t_max-t_min)/n;
  684. X    for (i=1; i<n; i++) {
  685. X       t = t + dt;
  686. X       m[i][0] = dt;
  687. X       m[i][2] = dt;
  688. X       m[i][1] = 2 * (m[i][0] + m[i][2]);
  689. X       r[i] = m[i][0] * ((p -> next -> Y) - (p -> Y)) / m[i][2]
  690. X            + m[i][2] * ((p -> next -> next -> Y) -
  691. X                         (p -> next -> Y)) / m[i][0];
  692. X       r[i] *= 3.0;
  693. X       p = p -> next;
  694. X    }
  695. X
  696. X    if (!solve_tri_diag(m, r, tangents_y, n+1)) { /* Find the Y(t) tangents. */
  697. X        free((char *) m);
  698. X        free((char *) r);
  699. X    int_error("Cannt interpolate Y using complete splines", NO_CARET);
  700. X    }
  701. X    free((char *) m);
  702. X    free((char *) r);
  703. }
  704. X
  705. /*
  706. X * Solve tri diagonal linear system equation. The tri diagonal matrix is
  707. X * defined via matrix M, right side is r, and solution X i.e. M * X = R.
  708. X * Size of system given in n. Return TRUE if solution exist.
  709. X */
  710. static int solve_tri_diag(m, r, x, n)
  711. tri_diag m[];
  712. double r[], x[];
  713. int n;
  714. {
  715. X    int i;
  716. X    double t;
  717. X
  718. X    for (i=1; i<n; i++) {   /* Eliminate element m[i][i-1] (lower diagonal). */
  719. X    if (m[i-1][1] == 0) return FALSE;
  720. X    t = m[i][0] / m[i-1][1];        /* Find ratio between the two lines. */
  721. X    m[i][0] = m[i][0] - m[i-1][1] * t;
  722. X    m[i][1] = m[i][1] - m[i-1][2] * t;
  723. X    r[i] = r[i] - r[i-1] * t;
  724. X    }
  725. X    /* Now do back subtitution - update the solution vector X: */
  726. X    if (m[n-1][1] == 0) return FALSE;
  727. X    x[n-1] = r[n-1] / m[n-1][1];               /* Find last element. */
  728. X    for (i=n-2; i>=0; i--) {
  729. X    if (m[i][1] == 0) return FALSE;
  730. X    x[i] = (r[i] - x[i+1] * m[i][2]) / m[i][1];
  731. X    }
  732. X    return TRUE;
  733. }
  734. X
  735. /*
  736. X * Generate a Bspline curve defined by all the points given in linked list p:
  737. X * Algorithm: using deBoor algorithm
  738. X * Note: if Curvekind is OPEN_CONTOUR than Open end knot vector is assumed,
  739. X *       else (CLOSED_CONTOUR) Float end knot vector is assumed.
  740. X * It is assumed that num_of_points is at list 2, and order of Bspline is less
  741. X * than num_of_points!
  742. X */
  743. static gen_bspline_approx(p_cntr, num_of_points, order, contour_kind)
  744. struct cntr_struct *p_cntr;
  745. int num_of_points, order, contour_kind;
  746. {
  747. X    int i, knot_index = 0, pts_count = 1;
  748. X    double dt, t, next_t, t_min, t_max, x, y;
  749. X    struct cntr_struct *pc_temp = p_cntr, *pc_tail;
  750. X
  751. X    /* If the contour is Closed one we must update few things:               */
  752. X    /* 1. Make the list temporary circular, so we can close the contour.     */
  753. X    /* 2. Update num_of_points - increase it by "order-1" so contour will be */
  754. X    /*    closed. This will evaluate order more sections to close it!        */
  755. X    if (contour_kind == CLOSED_CONTOUR) {
  756. X    pc_tail = p_cntr;
  757. X    while (pc_tail -> next) pc_tail = pc_tail -> next;/* Find last point.*/
  758. X    pc_tail -> next = p_cntr;   /* Close contour list - make it circular.*/
  759. X    num_of_points += order;
  760. X    }
  761. X
  762. X    /* Find first (t_min) and last (t_max) t value to eval: */
  763. X    t = t_min = fetch_knot(contour_kind, num_of_points, order, order);
  764. X    t_max = fetch_knot(contour_kind, num_of_points, order, num_of_points);
  765. X    next_t = t_min + 1.0;
  766. X    knot_index = order;
  767. X    dt = 1.0/num_approx_pts;            /* Number of points per one section. */
  768. X
  769. X
  770. X    while (t<t_max) {
  771. X    if (t > next_t) {
  772. X        pc_temp = pc_temp -> next;     /* Next order ctrl. pt. to blend. */
  773. X            knot_index++;
  774. X        next_t += 1.0;
  775. X    }
  776. X        eval_bspline(t, pc_temp, num_of_points, order, knot_index,
  777. X                        contour_kind, &x, &y);   /* Next pt. */
  778. X    add_cntr_point(x, y);
  779. X    pts_count++;
  780. X    /* As we might have some real number round off problems we must      */
  781. X    /* test if we dont produce too many points here...                   */
  782. X    if (pts_count + 1 == num_approx_pts * (num_of_points - order) + 1)
  783. X            break;
  784. X        t += dt;
  785. X    }
  786. X
  787. X    eval_bspline(t_max - EPSILON, pc_temp, num_of_points, order, knot_index,
  788. X        contour_kind, &x, &y);
  789. X    /* If from round off errors we need more than one last point: */
  790. X    for (i=pts_count; i<num_approx_pts * (num_of_points - order) + 1; i++)
  791. X    add_cntr_point(x, y);                /* Complete the contour. */
  792. X
  793. X    if (contour_kind == CLOSED_CONTOUR)     /* Update list - un-circular it. */
  794. X    pc_tail -> next = NULL;
  795. }
  796. X
  797. /*
  798. X * The recursive routine to evaluate the B-spline value at point t using
  799. X * knot vector PKList, and the control points Pdtemp. Returns x, y after the
  800. X * division by the weight w. Note that Pdtemp points on the first control
  801. X * point to blend with. The B-spline is of order order.
  802. X */
  803. static eval_bspline(t, p_cntr, num_of_points, order, j, contour_kind, x, y)
  804. double t;
  805. struct cntr_struct *p_cntr;
  806. int num_of_points, order, j, contour_kind;
  807. double *x, *y;
  808. {
  809. X    int i, p;
  810. X    double ti, tikp, *dx, *dy;      /* Copy p_cntr into it to make it faster. */
  811. X
  812. X    dx = (double *) alloc((unsigned) (sizeof(double) * (order + j)),
  813. X                        "contour b_spline");
  814. X    dy = (double *) alloc((unsigned) (sizeof(double) * (order + j)),
  815. X                        "contour b_spline");
  816. X    /* Set the dx/dy - [0] iteration step, control points (p==0 iterat.): */
  817. X    for (i=j-order; i<=j; i++) {
  818. X        dx[i] = p_cntr -> X;
  819. X        dy[i] = p_cntr -> Y;
  820. X        p_cntr = p_cntr -> next;
  821. X    }
  822. X
  823. X    for (p=1; p<=order; p++) {        /* Iteration (b-spline level) counter. */
  824. X    for (i=j; i>=j-order+p; i--) {           /* Control points indexing. */
  825. X            ti = fetch_knot(contour_kind, num_of_points, order, i);
  826. X            tikp = fetch_knot(contour_kind, num_of_points, order, i+order+1-p);
  827. X        if (ti == tikp) {   /* Should not be a problems but how knows... */
  828. X        }
  829. X        else {
  830. X        dx[i] = dx[i] * (t - ti)/(tikp-ti) +         /* Calculate x. */
  831. X            dx[i-1] * (tikp-t)/(tikp-ti);
  832. X        dy[i] = dy[i] * (t - ti)/(tikp-ti) +         /* Calculate y. */
  833. X            dy[i-1] * (tikp-t)/(tikp-ti);
  834. X        }
  835. X    }
  836. X    }
  837. X    *x = dx[j]; *y = dy[j];
  838. X    free((char *) dx);
  839. X    free((char *) dy);
  840. }
  841. X
  842. /*
  843. X * Routine to get the i knot from uniform knot vector. The knot vector
  844. X * might be float (Knot(i) = i) or open (where the first and last "order"
  845. X * knots are equal). contour_kind determines knot kind - OPEN_CONTOUR means
  846. X * open knot vector, and CLOSED_CONTOUR selects float knot vector.
  847. X * Note the knot vector is not exist and this routine simulates it existance
  848. X * Also note the indexes for the knot vector starts from 0.
  849. X */
  850. static double fetch_knot(contour_kind, num_of_points, order, i)
  851. int contour_kind, num_of_points, order, i;
  852. {
  853. X    switch (contour_kind) {
  854. X    case OPEN_CONTOUR:
  855. X        if (i <= order) return 0.0;
  856. X        else if (i <= num_of_points) return (double) (i - order);
  857. X         else return (double) (num_of_points - order);
  858. X    case CLOSED_CONTOUR:
  859. X        return (double) i;
  860. X    default: /* Should never happen */
  861. X        return 1.0;
  862. X    }
  863. }
  864. SHAR_EOF
  865. echo 'File gnuplot/contour.c is complete' &&
  866. chmod 0666 gnuplot/contour.c ||
  867. echo 'restore of gnuplot/contour.c failed'
  868. Wc_c="`wc -c < 'gnuplot/contour.c'`"
  869. test 41345 -eq "$Wc_c" ||
  870.     echo 'gnuplot/contour.c: original size 41345, current size' "$Wc_c"
  871. rm -f _shar_wnt_.tmp
  872. fi
  873. # ============= gnuplot/demo/1.dat ==============
  874. if test ! -d 'gnuplot/demo'; then
  875.     echo 'x - creating directory gnuplot/demo'
  876.     mkdir 'gnuplot/demo'
  877. fi
  878. if test -f 'gnuplot/demo/1.dat' -a X"$1" != X"-c"; then
  879.     echo 'x - skipping gnuplot/demo/1.dat (File already exists)'
  880.     rm -f _shar_wnt_.tmp
  881. else
  882. > _shar_wnt_.tmp
  883. echo 'x - extracting gnuplot/demo/1.dat (Text)'
  884. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/1.dat' &&
  885. -20.000000 -3.041676
  886. -19.000000 -3.036427
  887. -18.000000 -3.030596
  888. -17.000000 -3.024081
  889. -16.000000 -3.016755
  890. -15.000000 -3.008456
  891. -14.000000 -2.998978
  892. -13.000000 -2.988049
  893. -12.000000 -2.975310
  894. -11.000000 -2.960273
  895. -10.000000 -2.942255
  896. -9.000000 -2.920278
  897. -8.000000 -2.892883
  898. -7.000000 -2.857799
  899. -6.000000 -2.811295
  900. -5.000000 -2.746802
  901. -4.000000 -2.651635
  902. -3.000000 -2.498092
  903. -2.000000 -2.214297
  904. -1.000000 -1.570796
  905. 0.000000 0.000000
  906. 1.000000 1.570796
  907. 2.000000 2.214297
  908. 3.000000 2.498092
  909. 4.000000 2.651635
  910. 5.000000 2.746802
  911. 6.000000 2.811295
  912. 7.000000 2.857799
  913. 8.000000 2.892883
  914. 9.000000 2.920278
  915. 10.000000 2.942255
  916. 11.000000 2.960273
  917. 12.000000 2.975310
  918. 13.000000 2.988049
  919. 14.000000 2.998978
  920. 15.000000 3.008456
  921. 16.000000 3.016755
  922. 17.000000 3.024081
  923. 18.000000 3.030596
  924. 19.000000 3.036427
  925. SHAR_EOF
  926. chmod 0666 gnuplot/demo/1.dat ||
  927. echo 'restore of gnuplot/demo/1.dat failed'
  928. Wc_c="`wc -c < 'gnuplot/demo/1.dat'`"
  929. test 781 -eq "$Wc_c" ||
  930.     echo 'gnuplot/demo/1.dat: original size 781, current size' "$Wc_c"
  931. rm -f _shar_wnt_.tmp
  932. fi
  933. # ============= gnuplot/demo/2.dat ==============
  934. if test -f 'gnuplot/demo/2.dat' -a X"$1" != X"-c"; then
  935.     echo 'x - skipping gnuplot/demo/2.dat (File already exists)'
  936.     rm -f _shar_wnt_.tmp
  937. else
  938. > _shar_wnt_.tmp
  939. echo 'x - extracting gnuplot/demo/2.dat (Text)'
  940. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/2.dat' &&
  941. -20.000000 -6.083352
  942. -19.000000 -6.072853
  943. -18.000000 -6.061191
  944. -17.000000 -6.048162
  945. -16.000000 -6.033510
  946. -15.000000 -6.016913
  947. -14.000000 -5.997955
  948. -13.000000 -5.976098
  949. -12.000000 -5.950620
  950. -11.000000 -5.920546
  951. -10.000000 -5.884511
  952. -9.000000 -5.840556
  953. -8.000000 -5.785765
  954. -7.000000 -5.715597
  955. -6.000000 -5.622591
  956. -5.000000 -5.493603
  957. -4.000000 -5.303271
  958. -3.000000 -4.996183
  959. -2.000000 -4.428595
  960. -1.000000 -3.141593
  961. 0.000000 0.000000
  962. 1.000000 3.141593
  963. 2.000000 4.428595
  964. 3.000000 4.996183
  965. 4.000000 5.303271
  966. 5.000000 5.493603
  967. 6.000000 5.622591
  968. 7.000000 5.715597
  969. 8.000000 5.785765
  970. 9.000000 5.840556
  971. 10.000000 5.884511
  972. 11.000000 5.920546
  973. 12.000000 5.950620
  974. 13.000000 5.976098
  975. 14.000000 5.997955
  976. 15.000000 6.016913
  977. 16.000000 6.033510
  978. 17.000000 6.048162
  979. 18.000000 6.061191
  980. 19.000000 6.072853
  981. SHAR_EOF
  982. chmod 0666 gnuplot/demo/2.dat ||
  983. echo 'restore of gnuplot/demo/2.dat failed'
  984. Wc_c="`wc -c < 'gnuplot/demo/2.dat'`"
  985. test 781 -eq "$Wc_c" ||
  986.     echo 'gnuplot/demo/2.dat: original size 781, current size' "$Wc_c"
  987. rm -f _shar_wnt_.tmp
  988. fi
  989. # ============= gnuplot/demo/3.dat ==============
  990. if test -f 'gnuplot/demo/3.dat' -a X"$1" != X"-c"; then
  991.     echo 'x - skipping gnuplot/demo/3.dat (File already exists)'
  992.     rm -f _shar_wnt_.tmp
  993. else
  994. > _shar_wnt_.tmp
  995. echo 'x - extracting gnuplot/demo/3.dat (Text)'
  996. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/3.dat' &&
  997. -20.000000 -9.125028
  998. -19.000000 -9.109280
  999. -18.000000 -9.091787
  1000. -17.000000 -9.072243
  1001. -16.000000 -9.050265
  1002. -15.000000 -9.025369
  1003. -14.000000 -8.996933
  1004. -13.000000 -8.964147
  1005. -12.000000 -8.925931
  1006. -11.000000 -8.880819
  1007. -10.000000 -8.826766
  1008. -9.000000 -8.760835
  1009. -8.000000 -8.678648
  1010. -7.000000 -8.573396
  1011. -6.000000 -8.433886
  1012. -5.000000 -8.240405
  1013. -4.000000 -7.954906
  1014. -3.000000 -7.494275
  1015. -2.000000 -6.642892
  1016. -1.000000 -4.712389
  1017. 0.000000 0.000000
  1018. 1.000000 4.712389
  1019. 2.000000 6.642892
  1020. 3.000000 7.494275
  1021. 4.000000 7.954906
  1022. 5.000000 8.240405
  1023. 6.000000 8.433886
  1024. 7.000000 8.573396
  1025. 8.000000 8.678648
  1026. 9.000000 8.760835
  1027. 10.000000 8.826766
  1028. 11.000000 8.880819
  1029. 12.000000 8.925931
  1030. 13.000000 8.964147
  1031. 14.000000 8.996933
  1032. 15.000000 9.025369
  1033. 16.000000 9.050265
  1034. 17.000000 9.072243
  1035. 18.000000 9.091787
  1036. 19.000000 9.109280
  1037. SHAR_EOF
  1038. chmod 0666 gnuplot/demo/3.dat ||
  1039. echo 'restore of gnuplot/demo/3.dat failed'
  1040. Wc_c="`wc -c < 'gnuplot/demo/3.dat'`"
  1041. test 781 -eq "$Wc_c" ||
  1042.     echo 'gnuplot/demo/3.dat: original size 781, current size' "$Wc_c"
  1043. rm -f _shar_wnt_.tmp
  1044. fi
  1045. # ============= gnuplot/demo/contours.demo ==============
  1046. if test -f 'gnuplot/demo/contours.demo' -a X"$1" != X"-c"; then
  1047.     echo 'x - skipping gnuplot/demo/contours.demo (File already exists)'
  1048.     rm -f _shar_wnt_.tmp
  1049. else
  1050. > _shar_wnt_.tmp
  1051. echo 'x - extracting gnuplot/demo/contours.demo (Text)'
  1052. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/contours.demo' &&
  1053. set samples 20
  1054. set isosamples 21
  1055. set xlabel "X axis" -5,-2
  1056. set ylabel "Y axis" 4,-1
  1057. set zlabel "Z axis"
  1058. set title "3D gnu plot demo - contour plot"
  1059. set contour
  1060. splot x*y
  1061. pause -1 "Hit return to continue (1)"
  1062. set cntrparam levels 20
  1063. set title "3D gnu plot demo - contour plot (more contours)"
  1064. replot
  1065. pause -1 "Hit return to continue (2)"
  1066. set cntrparam levels 40
  1067. set title "3D gnu plot demo - contour plot (and again more contours)"
  1068. replot
  1069. pause -1 "Hit return to continue (3)"
  1070. set cntrparam levels 10
  1071. set title "3D gnu plot demo - contour plot on base grid"
  1072. set contour base
  1073. splot x**2-y**2
  1074. pause -1 "Hit return to continue (4)"
  1075. set title "3D gnu plot demo - contour plot on surface"
  1076. set contour surface
  1077. replot
  1078. pause -1 "Hit return to continue (5)"
  1079. set title "3D gnu plot demo - contour plot on both"
  1080. set contour both
  1081. replot
  1082. pause -1 "Hit return to continue (6)"
  1083. set contour base
  1084. set title "3D gnu plot demo - 2 surfaces
  1085. splot x**2*y**3, x**3*y**2
  1086. pause -1 "Hit return to continue (7)"
  1087. set title "3D gnu plot demo - some more interesting contours"
  1088. splot x*y / (x**2 + y**2 + 0.1)
  1089. pause -1 "Hit return to continue (8)"
  1090. splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
  1091. pause -1 "Hit return to continue (9)"
  1092. set zrange [-0.5:0.5]
  1093. replot
  1094. pause -1 "Hit return to continue (10)"
  1095. set samples 6
  1096. set isosamples 6
  1097. set cntrparam levels 5
  1098. set title "3D gnu plot demo - low resolution (6x6)"
  1099. replot
  1100. pause -1 "Hit return to continue (11)"
  1101. set cntrparam bspline
  1102. set title "3D gnu plot demo - low resolution (6x6) using bspline approx."
  1103. replot
  1104. pause -1 "Hit return to continue (12)"
  1105. set cntrparam order 8
  1106. set title "3D gnu plot demo - low resolution (6x6) raise bspline order."
  1107. replot
  1108. pause -1 "Hit return to continue (13)"
  1109. set cntrparam linear
  1110. set auto
  1111. set title "3D gnu plot demo - low resolution (6x6) using linear contours."
  1112. splot x*y
  1113. pause -1 "Hit return to continue (14)"
  1114. set cntrparam order 4
  1115. set cntrparam bspline
  1116. set title "3D gnu plot demo - low resolution (6x6) using bspline approx."
  1117. replot
  1118. pause -1 "Hit return to continue (15)"
  1119. set samples 25
  1120. set isosamples 26
  1121. set title "3D gnu plot demo - contour of Sinc function"
  1122. splot [-5:5.01] [-5:5.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
  1123. pause -1 "Hit return to continue (16)"
  1124. splot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
  1125. pause -1 "Hit return to continue (17)"
  1126. set cntrparam levels 10
  1127. set xrange [0:15]
  1128. set yrange [0:15]
  1129. set auto
  1130. set zrange [-0.6:0.6]
  1131. set data style lines
  1132. set title "3D gnu plot demo - contour of data grid plotting"
  1133. set parametric
  1134. splot "glass.dat"
  1135. pause -1 "Hit return to continue (18)"
  1136. set zrange [-1.2:1.2]
  1137. set noparametric
  1138. splot "glass.dat" using 1
  1139. pause -1 "Hit return to continue (19)"
  1140. set view 0,0,1
  1141. set nosurface
  1142. set title "3D gnu plot demo - 2D contour projection of last plot"
  1143. replot
  1144. pause -1 "Hit return to continue (20)"
  1145. X
  1146. X
  1147. #
  1148. # Clean up:
  1149. #
  1150. set surface
  1151. set nocontour
  1152. set cntrparam levels 5
  1153. set cntrparam linear
  1154. set samples 100
  1155. set isosamples 10
  1156. set view 60,30,1,1
  1157. set xrange [-10:10]
  1158. set yrange [-10:10]
  1159. set zrange [-10:10]
  1160. set auto
  1161. set title "" 0,0
  1162. set xlabel "" 0,0
  1163. set ylabel "" 0,0
  1164. set zlabel "" 0,0
  1165. SHAR_EOF
  1166. chmod 0644 gnuplot/demo/contours.demo ||
  1167. echo 'restore of gnuplot/demo/contours.demo failed'
  1168. Wc_c="`wc -c < 'gnuplot/demo/contours.demo'`"
  1169. test 3088 -eq "$Wc_c" ||
  1170.     echo 'gnuplot/demo/contours.demo: original size 3088, current size' "$Wc_c"
  1171. rm -f _shar_wnt_.tmp
  1172. fi
  1173. # ============= gnuplot/demo/controls.demo ==============
  1174. if test -f 'gnuplot/demo/controls.demo' -a X"$1" != X"-c"; then
  1175.     echo 'x - skipping gnuplot/demo/controls.demo (File already exists)'
  1176.     rm -f _shar_wnt_.tmp
  1177. else
  1178. > _shar_wnt_.tmp
  1179. echo 'x - extracting gnuplot/demo/controls.demo (Text)'
  1180. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/controls.demo' &&
  1181. #
  1182. # warning:  this demo is SLOW on PCs without math coprocessors!
  1183. #
  1184. # From _Automatic_Control_Systems_, fourth ed., figure 6-14
  1185. # transient response of a second-order system to a unit step input function
  1186. #
  1187. damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
  1188. per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
  1189. c(t) = 1-damp(t)*per(t)
  1190. #
  1191. #    wn is natural undamped frequency
  1192. #    s is damping factor
  1193. #
  1194. wn = 1.0
  1195. set xrange [0:13]
  1196. set samples 50
  1197. set dummy t
  1198. #
  1199. # plot c(t) for several different damping factors s
  1200. #
  1201. plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
  1202. pause -1 "Hit return to continue"
  1203. X
  1204. # undo what we have done
  1205. set xrange [-10:10]
  1206. set autoscale xy
  1207. set samples 160
  1208. set dummy x
  1209. X
  1210. SHAR_EOF
  1211. chmod 0666 gnuplot/demo/controls.demo ||
  1212. echo 'restore of gnuplot/demo/controls.demo failed'
  1213. Wc_c="`wc -c < 'gnuplot/demo/controls.demo'`"
  1214. test 712 -eq "$Wc_c" ||
  1215.     echo 'gnuplot/demo/controls.demo: original size 712, current size' "$Wc_c"
  1216. rm -f _shar_wnt_.tmp
  1217. fi
  1218. # ============= gnuplot/demo/electron.demo ==============
  1219. if test -f 'gnuplot/demo/electron.demo' -a X"$1" != X"-c"; then
  1220.     echo 'x - skipping gnuplot/demo/electron.demo (File already exists)'
  1221.     rm -f _shar_wnt_.tmp
  1222. else
  1223. > _shar_wnt_.tmp
  1224. echo 'x - extracting gnuplot/demo/electron.demo (Text)'
  1225. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/electron.demo' &&
  1226. # Electronics demo
  1227. #
  1228. # Bipolar Transistor (NPN) Mutual Characteristic
  1229. Ie(Vbe)=Ies*exp(Vbe/kT_q)
  1230. Ic(Vbe)=alpha*Ie(Vbe)+Ico
  1231. alpha = 0.99
  1232. Ies = 4e-14
  1233. Ico = 1e-09
  1234. kT_q = 0.025
  1235. set dummy Vbe
  1236. set grid
  1237. set offsets
  1238. set nolog
  1239. set nopolar
  1240. set samples 160
  1241. set title "Mutual Characteristic of a Transistor"
  1242. set xlabel "Vbe (base emmitter voltage)"
  1243. set xrange [0 : 0.75]
  1244. set ylabel "Ic (collector current)"
  1245. set yrange [0 : 0.005]
  1246. set key .2,.0045
  1247. set format y "%.4f"
  1248. plot Ic(Vbe)
  1249. set format "%g"
  1250. X
  1251. pause -1 "Hit return to continue"
  1252. X
  1253. # Junction Field Effect Transistor (JFET) Mutual Characteristic
  1254. # drain current above pinch off
  1255. Ida(Vd)=Ido*(1-Vg/Vp)**2
  1256. # drain current below pinch off
  1257. Idb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
  1258. # drain current
  1259. Id(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
  1260. # drain current at zero gate voltage
  1261. Ido = 2.5
  1262. # pinch off voltage
  1263. Vp = -1.25
  1264. # gate voltage
  1265. Vg = 0
  1266. set dummy Vd
  1267. set nogrid
  1268. set nokey
  1269. set offsets 0, 1, 0, 0
  1270. set title "JFET Mutual Characteristic"
  1271. set xlabel "Drain voltage Vd (V)"
  1272. set xrange [0 : 4]
  1273. set ylabel "Drain current Id (mA)"
  1274. set yrange [0 : 5]
  1275. set label "-0.5 Vp" at 4.1,0.625
  1276. set label "-0.25 Vp" at 4.1,1.4
  1277. set label "0" at 4.1,2.5
  1278. set label "Vg = 0.5 Vp" at 4.1,3.9
  1279. plot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
  1280. set nolabel
  1281. X
  1282. pause -1 "Hit return to continue"
  1283. X
  1284. # amplitude frequency response
  1285. A(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
  1286. p1 = 10
  1287. p2 = 10000
  1288. set dummy jw
  1289. set grid
  1290. set key
  1291. set logscale xy
  1292. set offsets 0, 0, 0, 0
  1293. set title "Amplitude Frequency Response"
  1294. set xlabel "jw (radians)"
  1295. set xrange [1.1 : 90000.0]
  1296. set ylabel "magnitude of A(jw)"
  1297. set autoscale  y
  1298. plot abs(A(jw))
  1299. X
  1300. pause -1 "Hit return to continue"
  1301. X
  1302. # phase frequency response
  1303. set nolog y
  1304. set logscale x
  1305. set title "Phase Frequency Response"
  1306. set ylabel "Phase of A(jw) (degrees)"
  1307. plot 180/pi*arg(A(jw))
  1308. X
  1309. pause -1 "Hit return to continue"
  1310. X
  1311. # undo what we've done
  1312. set dummy x
  1313. set nogrid
  1314. set offsets 0,0,0,0
  1315. set title ""
  1316. set ylabel ""
  1317. set xlabel ""
  1318. set xrange [-10:10]
  1319. set autoscale xy
  1320. set key
  1321. set format xy "%g"
  1322. set nolabel
  1323. set nolog
  1324. SHAR_EOF
  1325. chmod 0666 gnuplot/demo/electron.demo ||
  1326. echo 'restore of gnuplot/demo/electron.demo failed'
  1327. Wc_c="`wc -c < 'gnuplot/demo/electron.demo'`"
  1328. test 2065 -eq "$Wc_c" ||
  1329.     echo 'gnuplot/demo/electron.demo: original size 2065, current size' "$Wc_c"
  1330. rm -f _shar_wnt_.tmp
  1331. fi
  1332. # ============= gnuplot/demo/glass.dat ==============
  1333. if test -f 'gnuplot/demo/glass.dat' -a X"$1" != X"-c"; then
  1334.     echo 'x - skipping gnuplot/demo/glass.dat (File already exists)'
  1335.     rm -f _shar_wnt_.tmp
  1336. else
  1337. > _shar_wnt_.tmp
  1338. echo 'x - extracting gnuplot/demo/glass.dat (Text)'
  1339. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/demo/glass.dat' &&
  1340. #
  1341. # 16x16 grid Glass shape. Created Using DRAWFN3D, Gershon Elber 1990.
  1342. #
  1343. X  0.568000   0.000000  -0.911000
  1344. X  0.518894   0.231026  -0.911000
  1345. X  0.380066   0.422106  -0.911000
  1346. X  0.175522   0.540200  -0.911000
  1347. X -0.059372   0.564888  -0.911000
  1348. X -0.284000   0.491902  -0.911000
  1349. X -0.459522   0.333862  -0.911000
  1350. X -0.555588   0.118094  -0.911000
  1351. X -0.555588  -0.118094  -0.911000
  1352. X -0.459522  -0.333862  -0.911000
  1353. X -0.284000  -0.491902  -0.911000
  1354. X -0.059372  -0.564888  -0.911000
  1355. X  0.175522  -0.540200  -0.911000
  1356. X  0.380066  -0.422106  -0.911000
  1357. X  0.518894  -0.231027  -0.911000
  1358. X  0.568000  -0.000000  -0.911000
  1359. X
  1360. X  0.341741   0.000000  -0.905215
  1361. X  0.312196   0.138999  -0.905215
  1362. X  0.228669   0.253963  -0.905215
  1363. X  0.105604   0.325015  -0.905215
  1364. X -0.035722   0.339869  -0.905215
  1365. X -0.170870   0.295956  -0.905215
  1366. X -0.276474   0.200870  -0.905215
  1367. X -0.334273   0.071052  -0.905215
  1368. X -0.334273  -0.071052  -0.905215
  1369. X -0.276474  -0.200870  -0.905215
  1370. X -0.170871  -0.295956  -0.905215
  1371. X -0.035722  -0.339869  -0.905215
  1372. X  0.105604  -0.325015  -0.905215
  1373. X  0.228669  -0.253963  -0.905215
  1374. X  0.312196  -0.138999  -0.905215
  1375. X  0.341741  -0.000000  -0.905215
  1376. X
  1377. X  0.212153   0.000000  -0.863178
  1378. X  0.193812   0.086290  -0.863178
  1379. X  0.141958   0.157661  -0.863178
  1380. X  0.065559   0.201770  -0.863178
  1381. X -0.022176   0.210991  -0.863178
  1382. X -0.106077   0.183730  -0.863178
  1383. X -0.171636   0.124701  -0.863178
  1384. X -0.207517   0.044109  -0.863178
  1385. X -0.207517  -0.044109  -0.863178
  1386. X -0.171636  -0.124701  -0.863178
  1387. X -0.106077  -0.183730  -0.863178
  1388. X -0.022176  -0.210991  -0.863178
  1389. X  0.065559  -0.201770  -0.863178
  1390. X  0.141958  -0.157661  -0.863178
  1391. X  0.193812  -0.086291  -0.863178
  1392. X  0.212153  -0.000000  -0.863178
  1393. X
  1394. X  0.138097   0.000000  -0.764660
  1395. X  0.126157   0.056169  -0.764660
  1396. X  0.092405   0.102626  -0.764660
  1397. X  0.042674   0.131338  -0.764660
  1398. X -0.014435   0.137340  -0.764660
  1399. X -0.069048   0.119595  -0.764660
  1400. X -0.111722   0.081171  -0.764660
  1401. X -0.135079   0.028712  -0.764660
  1402. X -0.135079  -0.028712  -0.764660
  1403. X -0.111722  -0.081171  -0.764660
  1404. X -0.069048  -0.119595  -0.764660
  1405. X -0.014435  -0.137340  -0.764660
  1406. X  0.042674  -0.131338  -0.764660
  1407. X  0.092405  -0.102626  -0.764660
  1408. X  0.126157  -0.056169  -0.764660
  1409. X  0.138097  -0.000000  -0.764660
  1410. X
  1411. X  0.098588   0.000000  -0.618872
  1412. X  0.090065   0.040099  -0.618872
  1413. X  0.065968   0.073265  -0.618872
  1414. X  0.030465   0.093763  -0.618872
  1415. X -0.010305   0.098048  -0.618872
  1416. X -0.049294   0.085380  -0.618872
  1417. X -0.079760   0.057949  -0.618872
  1418. X -0.096434   0.020498  -0.618872
  1419. X -0.096434  -0.020498  -0.618872
  1420. X -0.079760  -0.057949  -0.618872
  1421. X -0.049294  -0.085380  -0.618872
  1422. X -0.010305  -0.098048  -0.618872
  1423. X  0.030465  -0.093763  -0.618872
  1424. X  0.065968  -0.073265  -0.618872
  1425. X  0.090065  -0.040099  -0.618872
  1426. X  0.098588  -0.000000  -0.618872
  1427. X
  1428. X  0.084164   0.000000  -0.452254
  1429. X  0.076887   0.034232  -0.452254
  1430. X  0.056317   0.062546  -0.452254
  1431. X  0.026008   0.080044  -0.452254
  1432. X -0.008798   0.083703  -0.452254
  1433. X -0.042082   0.072888  -0.452254
  1434. X -0.068090   0.049470  -0.452254
  1435. X -0.082325   0.017499  -0.452254
  1436. X -0.082325  -0.017499  -0.452254
  1437. X -0.068090  -0.049470  -0.452254
  1438. X -0.042082  -0.072888  -0.452254
  1439. X -0.008798  -0.083703  -0.452254
  1440. X  0.026008  -0.080045  -0.452254
  1441. X  0.056317  -0.062546  -0.452254
  1442. X  0.076887  -0.034233  -0.452254
  1443. X  0.084164  -0.000000  -0.452254
  1444. X
  1445. X  0.092386   0.000000  -0.291706
  1446. X  0.084399   0.037577  -0.291706
  1447. X  0.061819   0.068656  -0.291706
  1448. X  0.028549   0.087865  -0.291706
  1449. X -0.009657   0.091880  -0.291706
  1450. X -0.046193   0.080009  -0.291706
  1451. X -0.074742   0.054303  -0.291706
  1452. X -0.090368   0.019208  -0.291706
  1453. X -0.090368  -0.019208  -0.291706
  1454. X -0.074742  -0.054303  -0.291706
  1455. X -0.046193  -0.080009  -0.291706
  1456. X -0.009657  -0.091880  -0.291706
  1457. X  0.028549  -0.087865  -0.291706
  1458. X  0.061819  -0.068656  -0.291706
  1459. X  0.084399  -0.037577  -0.291706
  1460. X  0.092386  -0.000000  -0.291706
  1461. X
  1462. X  0.124988   0.000000  -0.153861
  1463. X  0.114183   0.050837  -0.153861
  1464. X  0.083634   0.092885  -0.153861
  1465. X  0.038624   0.118871  -0.153861
  1466. X -0.013065   0.124304  -0.153861
  1467. X -0.062494   0.108243  -0.153861
  1468. X -0.101118   0.073466  -0.153861
  1469. X -0.122257   0.025987  -0.153861
  1470. X -0.122257  -0.025987  -0.153861
  1471. X -0.101118  -0.073466  -0.153861
  1472. X -0.062494  -0.108243  -0.153861
  1473. X -0.013065  -0.124304  -0.153861
  1474. X  0.038624  -0.118871  -0.153861
  1475. X  0.083634  -0.092885  -0.153861
  1476. X  0.114183  -0.050837  -0.153861
  1477. X  0.124988  -0.000000  -0.153861
  1478. X
  1479. X  0.185015   0.000000  -0.041791
  1480. X  0.169020   0.075253  -0.041791
  1481. X  0.123799   0.137493  -0.041791
  1482. X  0.057173   0.175960  -0.041791
  1483. X -0.019339   0.184002  -0.041791
  1484. X -0.092508   0.160228  -0.041791
  1485. X -0.149681   0.108749  -0.041791
  1486. X -0.180972   0.038467  -0.041791
  1487. X -0.180972  -0.038467  -0.041791
  1488. X -0.149681  -0.108749  -0.041791
  1489. X -0.092508  -0.160228  -0.041791
  1490. X -0.019339  -0.184002  -0.041791
  1491. X  0.057173  -0.175960  -0.041791
  1492. X  0.123799  -0.137493  -0.041791
  1493. X  0.169020  -0.075253  -0.041791
  1494. X  0.185015  -0.000000  -0.041791
  1495. X
  1496. X  0.273264   0.000000   0.053395
  1497. X  0.249639   0.111146   0.053395
  1498. X  0.182849   0.203075   0.053395
  1499. X  0.084443   0.259889   0.053395
  1500. X -0.028564   0.271767   0.053395
  1501. X -0.136632   0.236653   0.053395
  1502. X -0.221075   0.160620   0.053395
  1503. X -0.267292   0.056815   0.053395
  1504. X -0.267292  -0.056815   0.053395
  1505. X -0.221075  -0.160620   0.053395
  1506. X -0.136632  -0.236653   0.053395
  1507. X -0.028564  -0.271767   0.053395
  1508. X  0.084443  -0.259889   0.053395
  1509. X  0.182849  -0.203075   0.053395
  1510. X  0.249639  -0.111146   0.053395
  1511. X  0.273264  -0.000000   0.053395
  1512. X
  1513. X  0.384384   0.000000   0.149114
  1514. X  0.351152   0.156343   0.149114
  1515. X  0.257203   0.285653   0.149114
  1516. X  0.118781   0.365570   0.149114
  1517. X -0.040179   0.382278   0.149114
  1518. X -0.192192   0.332886   0.149114
  1519. X -0.310973   0.225935   0.149114
  1520. X -0.375984   0.079918   0.149114
  1521. X -0.375984  -0.079918   0.149114
  1522. X -0.310973  -0.225935   0.149114
  1523. X -0.192192  -0.332886   0.149114
  1524. X -0.040179  -0.382278   0.149114
  1525. X  0.118781  -0.365571   0.149114
  1526. X  0.257203  -0.285653   0.149114
  1527. X  0.351152  -0.156343   0.149114
  1528. X  0.384384  -0.000000   0.149114
  1529. X
  1530. X  0.504089   0.000000   0.267473
  1531. X  0.460508   0.205031   0.267473
  1532. X  0.337301   0.374611   0.267473
  1533. X  0.155772   0.479417   0.267473
  1534. X -0.052692   0.501327   0.267473
  1535. X -0.252044   0.436554   0.267473
  1536. X -0.407816   0.296296   0.267473
  1537. X -0.493073   0.104806   0.267473
  1538. X -0.493073  -0.104806   0.267473
  1539. X -0.407816  -0.296296   0.267473
  1540. X -0.252044  -0.436554   0.267473
  1541. SHAR_EOF
  1542. true || echo 'restore of gnuplot/demo/glass.dat failed'
  1543. fi
  1544. echo 'End of  part 5'
  1545. echo 'File gnuplot/demo/glass.dat is continued in part 6'
  1546. echo 6 > _shar_seq_.tmp
  1547. exit 0
  1548.  
  1549. exit 0 # Just in case...
  1550. -- 
  1551. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1552. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1553. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1554. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1555.