Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:42:49

0001 /// @file
0002 /// @ingroup public_apis
0003 /*************************************************************************
0004  * Copyright (c) 2011 AT&T Intellectual Property 
0005  * All rights reserved. This program and the accompanying materials
0006  * are made available under the terms of the Eclipse Public License v1.0
0007  * which accompanies this distribution, and is available at
0008  * https://www.eclipse.org/legal/epl-v10.html
0009  *
0010  * Contributors: Details at https://graphviz.org
0011  *************************************************************************/
0012 
0013 /* geometric functions (e.g. on points and boxes) with application to, but
0014  * no specific dependence on graphs */
0015 
0016 #pragma once
0017 
0018 #include <limits.h>
0019 #include <math.h>
0020 
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024 
0025 #ifdef MIN
0026 #undef MIN
0027 #endif
0028 #define MIN(a,b)    ((a)<(b)?(a):(b))
0029 
0030 #ifdef MAX
0031 #undef MAX
0032 #endif
0033 #define MAX(a,b)    ((a)>(b)?(a):(b))
0034 
0035 #ifdef BETWEEN
0036 #undef BETWEEN
0037 #endif
0038 #define BETWEEN(a,b,c)  (((a) <= (b)) && ((b) <= (c)))
0039 
0040 #ifndef M_PI
0041 #define M_PI        3.14159265358979323846
0042 #endif
0043 
0044 #ifndef SQRT2
0045 #define SQRT2       1.41421356237309504880
0046 #endif
0047 
0048 #define ROUND(f)        ((f>=0)?(int)(f + .5):(int)(f - .5))
0049 #define RADIANS(deg)    ((deg)/180.0 * M_PI)
0050 #define DEGREES(rad)    ((rad)/M_PI * 180.0)
0051 
0052 #define SQR(a) ((a) * (a))
0053 
0054 #ifdef __cplusplus
0055 }
0056 #endif