Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches

geometric types and macros (e.g. points and boxes) More...

#include "arith.h"
Include dependency graph for geom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  point
 
struct  pointf_s
 
struct  linef
 
struct  box
 
struct  boxf
 

Macros

#define HAVE_POINTF_S
 
#define INSIDE(p, b)   (BETWEEN((b).LL.x,(p).x,(b).UR.x) && BETWEEN((b).LL.y,(p).y,(b).UR.y))
 
#define OVERLAP(b0, b1)   (((b0).UR.x >= (b1).LL.x) && ((b1).UR.x >= (b0).LL.x) && ((b0).UR.y >= (b1).LL.y) && ((b1).UR.y >= (b0).LL.y))
 
#define CONTAINS(b0, b1)   (((b0).UR.x >= (b1).UR.x) && ((b0).UR.y >= (b1).UR.y) && ((b0).LL.x <= (b1).LL.x) && ((b0).LL.y <= (b1).LL.y))
 
#define EXPANDBP(b, p)   ((b).LL.x = MIN((b).LL.x, (p).x), (b).LL.y = MIN((b).LL.y, (p).y), (b).UR.x = MAX((b).UR.x, (p).x), (b).UR.y = MAX((b).UR.y, (p).y))
 
#define EXPANDBB(b0, b1)   ((b0).LL.x = MIN((b0).LL.x, (b1).LL.x), (b0).LL.y = MIN((b0).LL.y, (b1).LL.y), (b0).UR.x = MAX((b0).UR.x, (b1).UR.x), (b0).UR.y = MAX((b0).UR.y, (b1).UR.y))
 
#define LEN2(a, b)   (SQR(a) + SQR(b))
 
#define DIST2(p, q)   (LEN2(((p).x - (q).x),((p).y - (q).y)))
 
#define DIST(p, q)   (sqrt(DIST2((p),(q))))
 
#define POINTS_PER_INCH   72
 
#define POINTS_PER_CM   ((double)POINTS_PER_INCH * 0.393700787)
 
#define POINTS_PER_MM   ((double)POINTS_PER_INCH * 0.0393700787)
 
#define POINTS(a_inches)   (ROUND((a_inches)*POINTS_PER_INCH))
 
#define INCH2PS(a_inches)   ((a_inches)*(double)POINTS_PER_INCH)
 
#define PS2INCH(a_points)   ((a_points)/(double)POINTS_PER_INCH)
 
#define P2PF(p, pf)   ((pf).x = (p).x,(pf).y = (p).y)
 
#define PF2P(pf, p)   ((p).x = ROUND((pf).x),(p).y = ROUND((pf).y))
 
#define B2BF(b, bf)   (P2PF((b).LL,(bf).LL),P2PF((b).UR,(bf).UR))
 
#define APPROXEQPT(p, q, tol)   (DIST2((p),(q)) < SQR(tol))
 
#define MILLIPOINT   .001
 

Typedefs

typedef struct pointf_s pointf
 

Detailed Description

with application to, but no specific dependence on graphs

Definition in file geom.h.

Macro Definition Documentation

◆ APPROXEQPT

#define APPROXEQPT (   p,
  q,
  tol 
)    (DIST2((p),(q)) < SQR(tol))

Definition at line 77 of file geom.h.

◆ B2BF

#define B2BF (   b,
  bf 
)    (P2PF((b).LL,(bf).LL),P2PF((b).UR,(bf).UR))

Definition at line 75 of file geom.h.

◆ CONTAINS

#define CONTAINS (   b0,
  b1 
)    (((b0).UR.x >= (b1).UR.x) && ((b0).UR.y >= (b1).UR.y) && ((b0).LL.x <= (b1).LL.x) && ((b0).LL.y <= (b1).LL.y))

Definition at line 51 of file geom.h.

◆ DIST

#define DIST (   p,
 
)    (sqrt(DIST2((p),(q))))

Definition at line 62 of file geom.h.

◆ DIST2

#define DIST2 (   p,
 
)    (LEN2(((p).x - (q).x),((p).y - (q).y)))

Definition at line 61 of file geom.h.

◆ EXPANDBB

#define EXPANDBB (   b0,
  b1 
)    ((b0).LL.x = MIN((b0).LL.x, (b1).LL.x), (b0).LL.y = MIN((b0).LL.y, (b1).LL.y), (b0).UR.x = MAX((b0).UR.x, (b1).UR.x), (b0).UR.y = MAX((b0).UR.y, (b1).UR.y))

Definition at line 57 of file geom.h.

◆ EXPANDBP

#define EXPANDBP (   b,
 
)    ((b).LL.x = MIN((b).LL.x, (p).x), (b).LL.y = MIN((b).LL.y, (p).y), (b).UR.x = MAX((b).UR.x, (p).x), (b).UR.y = MAX((b).UR.y, (p).y))

Definition at line 54 of file geom.h.

◆ HAVE_POINTF_S

#define HAVE_POINTF_S

Definition at line 37 of file geom.h.

◆ INCH2PS

#define INCH2PS (   a_inches)    ((a_inches)*(double)POINTS_PER_INCH)

Definition at line 69 of file geom.h.

◆ INSIDE

#define INSIDE (   p,
 
)    (BETWEEN((b).LL.x,(p).x,(b).UR.x) && BETWEEN((b).LL.y,(p).y,(b).UR.y))

Definition at line 45 of file geom.h.

◆ LEN2

#define LEN2 (   a,
 
)    (SQR(a) + SQR(b))

Definition at line 59 of file geom.h.

◆ MILLIPOINT

#define MILLIPOINT   .001

Definition at line 80 of file geom.h.

◆ OVERLAP

#define OVERLAP (   b0,
  b1 
)    (((b0).UR.x >= (b1).LL.x) && ((b1).UR.x >= (b0).LL.x) && ((b0).UR.y >= (b1).LL.y) && ((b1).UR.y >= (b0).LL.y))

Definition at line 48 of file geom.h.

◆ P2PF

#define P2PF (   p,
  pf 
)    ((pf).x = (p).x,(pf).y = (p).y)

Definition at line 72 of file geom.h.

◆ PF2P

#define PF2P (   pf,
 
)    ((p).x = ROUND((pf).x),(p).y = ROUND((pf).y))

Definition at line 73 of file geom.h.

◆ POINTS

#define POINTS (   a_inches)    (ROUND((a_inches)*POINTS_PER_INCH))

Definition at line 68 of file geom.h.

◆ POINTS_PER_CM

#define POINTS_PER_CM   ((double)POINTS_PER_INCH * 0.393700787)

Definition at line 65 of file geom.h.

◆ POINTS_PER_INCH

#define POINTS_PER_INCH   72

Definition at line 64 of file geom.h.

◆ POINTS_PER_MM

#define POINTS_PER_MM   ((double)POINTS_PER_INCH * 0.0393700787)

Definition at line 66 of file geom.h.

◆ PS2INCH

#define PS2INCH (   a_points)    ((a_points)/(double)POINTS_PER_INCH)

Definition at line 70 of file geom.h.

Typedef Documentation

◆ pointf

typedef struct pointf_s pointf