Graphviz 12.1.0~dev.20240716.0947
Loading...
Searching...
No Matches
intersect.c File Reference
#include <cgraph/unreachable.h>
#include <cgraph/exit.h>
#include <math.h>
#include <stdio.h>
#include "simple.h"
#include <stdlib.h>
Include dependency graph for intersect.c:

Go to the source code of this file.

Functions

static int sign (double v)
 
static void sgnarea (struct vertex *l, struct vertex *m, int i[])
 
static int between (double f, double g, double h)
 
static int online (struct vertex *l, struct vertex *m, int i)
 
static int intpoint (struct vertex *l, struct vertex *m, float *x, float *y, int cond)
 
void find_intersection (struct vertex *l, struct vertex *m, struct intersection ilist[], struct data *input)
 detect whether lines l and m intersect
 

Function Documentation

◆ between()

static int between ( double  f,
double  g,
double  h 
)
static

where is g relative to the interval delimited by f and h?

The order of f and h is not assumed. That is, the interval defined may be (f, h) or (h, f) depending on whether f is less than or greater than h.

Parameters
fFirst boundary of the interval
gValue to test
hSecond boundary of the interval
Returns
-1 if g is not in the interval, 1 if g is in the interval, 0 if g is on the boundary (that is, equal to f or equal to h)

Definition at line 59 of file intersect.c.

Referenced by online().

Here is the caller graph for this function:

◆ find_intersection()

void find_intersection ( struct vertex l,
struct vertex m,
struct intersection  ilist[],
struct data input 
)

Definition at line 159 of file intersect.c.

References intersection::firstp, intersection::firstv, graphviz_exit(), intpoint(), MAX, MAXINTS, data::ninters, online(), vertex::poly, intersection::secondp, intersection::secondv, sgnarea(), position::x, intersection::x, position::y, and intersection::y.

Here is the call graph for this function:

◆ intpoint()

static int intpoint ( struct vertex l,
struct vertex m,
float *  x,
float *  y,
int  cond 
)
static

Definition at line 93 of file intersect.c.

References after, le, online(), vertex::pos, SLOPE, UNREACHABLE, position::x, and position::y.

Referenced by find_intersection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ online()

static int online ( struct vertex l,
struct vertex m,
int  i 
)
static

Definition at line 82 of file intersect.c.

References after, between(), vertex::pos, position::x, and position::y.

Referenced by find_intersection(), and intpoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgnarea()

static void sgnarea ( struct vertex l,
struct vertex m,
int  i[] 
)
static

Definition at line 29 of file intersect.c.

References after, vertex::pos, sign(), pointf_s::x, and pointf_s::y.

Referenced by find_intersection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sign()

static int sign ( double  v)
static

Definition at line 18 of file intersect.c.

Referenced by sgnarea().

Here is the caller graph for this function: