1 | /* $Id$ $Revision$ */ |
2 | /* vim:set shiftwidth=4 ts=8: */ |
3 | |
4 | /************************************************************************* |
5 | * Copyright (c) 2011 AT&T Intellectual Property |
6 | * All rights reserved. This program and the accompanying materials |
7 | * are made available under the terms of the Eclipse Public License v1.0 |
8 | * which accompanies this distribution, and is available at |
9 | * http://www.eclipse.org/legal/epl-v10.html |
10 | * |
11 | * Contributors: See CVS logs. Details at http://www.graphviz.org/ |
12 | *************************************************************************/ |
13 | |
14 | #ifdef __cplusplus |
15 | extern "C" { |
16 | #endif |
17 | |
18 | |
19 | |
20 | #ifndef GEOMETRY_H |
21 | #define GEOMETRY_H |
22 | |
23 | #ifdef HAVE_POINTF_S |
24 | typedef pointf Point; |
25 | #else |
26 | typedef struct Point { |
27 | double x, y; |
28 | } Point; |
29 | #endif |
30 | |
31 | extern Point origin; |
32 | |
33 | extern double xmin, xmax, ymin, ymax; /* extreme x,y values of sites */ |
34 | extern double deltax, deltay; /* xmax - xmin, ymax - ymin */ |
35 | |
36 | extern int nsites; /* Number of sites */ |
37 | extern int sqrt_nsites; |
38 | |
39 | extern void geominit(void); |
40 | extern double dist_2(Point *, Point *); /* Distance squared between two points */ |
41 | extern void subpt(Point * a, Point b, Point c); |
42 | extern void addpt(Point * a, Point b, Point c); |
43 | extern double area_2(Point a, Point b, Point c); |
44 | extern int leftOf(Point a, Point b, Point c); |
45 | extern int intersection(Point a, Point b, Point c, Point d, Point * p); |
46 | |
47 | #endif |
48 | |
49 | |
50 | #ifdef __cplusplus |
51 | } |
52 | #endif |
53 | |