Graphviz 13.1.3~dev.20250829.0113
Loading...
Searching...
No Matches
geometry.h
Go to the documentation of this file.
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
15#if !defined(__CYGWIN__) && defined(__GNUC__) && !defined(__MINGW32__)
16#define INTERNAL __attribute__((visibility("hidden")))
17#else
18#define INTERNAL /* nothing */
19#endif
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#ifdef HAVE_POINTF_S
26 typedef pointf Point;
27#else
28 typedef struct Point {
29 double x, y;
31#endif
32
33 extern double xmin, xmax, ymin, ymax; /* extreme x,y values of sites */
34 extern double deltax; // xmax - xmin
35
36 extern size_t nsites; // Number of sites
37 extern int sqrt_nsites;
38
39INTERNAL void geominit(void);
40INTERNAL double dist_2(Point, Point);
41INTERNAL void subpt(Point * a, Point b, Point c);
42INTERNAL void addpt(Point * a, Point b, Point c);
43INTERNAL double area_2(Point a, Point b, Point c);
44INTERNAL int leftOf(Point a, Point b, Point c);
45INTERNAL int intersection(Point a, Point b, Point c, Point d, Point * p);
46
47#undef INTERNAL
48
49#ifdef __cplusplus
50}
51#endif
INTERNAL void addpt(Point *a, Point b, Point c)
Definition geometry.c:42
#define INTERNAL
Definition geometry.h:18
size_t nsites
Definition geometry.c:18
double deltax
Definition geometry.c:16
INTERNAL double dist_2(Point, Point)
distance squared between two points
Definition geometry.c:29
double xmax
Definition geometry.h:33
INTERNAL double area_2(Point a, Point b, Point c)
Definition geometry.c:48
double ymin
Definition geometry.h:33
INTERNAL void subpt(Point *a, Point b, Point c)
Definition geometry.c:36
double xmin
Definition geometry.c:15
INTERNAL void geominit(void)
Definition geometry.c:21
int sqrt_nsites
Definition geometry.c:19
double ymax
Definition geometry.h:33
INTERNAL int leftOf(Point a, Point b, Point c)
Definition geometry.c:53
double x
Definition geometry.h:29
double y
Definition geometry.h:29