Jamoma API
0.6.0.a19
|
Compute convex hulls in 2 dimensions. More...
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | NEW(p, type) if ((p=(type *) malloc (sizeof(type))) == NULL) {exit(EXIT_FAILURE);} |
Macros. | |
Typedefs | |
typedef double | t_xy[2] |
Data structures to store a 2 dimensional convex hull. | |
Compute convex hulls in 2 dimensions.
This code is described in "Computational Geometry in C" (Second Edition), Chapter 3. It is not written to be comprehensible without the explanation in that book.
Input: 2n integer coordinates of points in the plane. Output: the convex hull, cw, in PostScript; other output precedes the PS.
NB: The original array storing the points is overwritten.
Compile: gcc -o graham graham.c (or simply: make)
Written by Joseph O'Rourke. Last modified: October 1997 Questions to orour. ke@c s.smi th.e du
Definition in file hull2D.h.