| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <stddef.h> |
| 14 |
#include <util/api.h> |
| 15 |
|
| 16 |
#ifdef __cplusplus |
| 17 |
extern "C" { |
| 18 |
#endif |
| 19 |
|
| 20 |
#ifdef HAVE_POINTF_S |
| 21 |
typedef pointf Point; |
| 22 |
#else |
| 23 |
typedef struct Point { |
| 24 |
double x, y; |
| 25 |
} Point; |
| 26 |
#endif |
| 27 |
|
| 28 |
extern double xmin, xmax, ymin, ymax; /* extreme x,y values of sites */ |
| 29 |
extern double deltax; // xmax - xmin |
| 30 |
|
| 31 |
extern size_t nsites; // Number of sites |
| 32 |
extern int sqrt_nsites; |
| 33 |
|
| 34 |
PRIVATE void geominit(void); |
| 35 |
PRIVATE double dist_2(Point, Point); ///< distance squared between two points |
| 36 |
PRIVATE void subpt(Point * a, Point b, Point c); |
| 37 |
PRIVATE void addpt(Point * a, Point b, Point c); |
| 38 |
PRIVATE double area_2(Point a, Point b, Point c); |
| 39 |
PRIVATE int leftOf(Point a, Point b, Point c); |
| 40 |
PRIVATE int intersection(Point a, Point b, Point c, Point d, Point * p); |
| 41 |
|
| 42 |
#ifdef __cplusplus |
| 43 |
} |
| 44 |
#endif |