Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
ellipse.c File Reference
#include <assert.h>
#include <cgraph/alloc.h>
#include <cgraph/list.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <common/render.h>
#include <pathplan/pathplan.h>
Include dependency graph for ellipse.c:

Go to the source code of this file.

Data Structures

struct  ellipse_t
 

Macros

#define TWOPI   (2*M_PI)
 
#define RationalFunction(x, c)   ((x * (x * c[0] + c[1]) + c[2]) / (x + c[3]))
 

Typedefs

typedef double erray_t[2][4][4]
 

Functions

static void initEllipse (ellipse_t *ep, double cx, double cy, double a, double b, double lambda1, double lambda2)
 
static double estimateError (ellipse_t *ep, double etaA, double etaB)
 
static void moveTo (bezier_path_t *polypath, double x, double y)
 
static void curveTo (bezier_path_t *polypath, double x1, double y1, double x2, double y2, double x3, double y3)
 
static void lineTo (bezier_path_t *polypath, double x, double y)
 
static void endPath (bezier_path_t *polypath)
 
static Ppolyline_tgenEllipticPath (ellipse_t *ep)
 
Ppolyline_tellipticWedge (pointf ctr, double xsemi, double ysemi, double angle0, double angle1)
 

Variables

static erray_t coeffs3Low
 
static erray_t coeffs3High
 
static double safety3 []
 

Macro Definition Documentation

◆ RationalFunction

#define RationalFunction (   x,
 
)    ((x * (x * c[0] + c[1]) + c[2]) / (x + c[3]))

Definition at line 138 of file ellipse.c.

◆ TWOPI

#define TWOPI   (2*M_PI)

Definition at line 60 of file ellipse.c.

Typedef Documentation

◆ erray_t

typedef double erray_t[2][4][4]

Definition at line 90 of file ellipse.c.

Function Documentation

◆ curveTo()

static void curveTo ( bezier_path_t *  polypath,
double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)
static

Definition at line 182 of file ellipse.c.

Referenced by genEllipticPath(), and lineTo().

Here is the caller graph for this function:

◆ ellipticWedge()

Ppolyline_t * ellipticWedge ( pointf  ctr,
double  xsemi,
double  ysemi,
double  angle0,
double  angle1 
)

Definition at line 298 of file ellipse.c.

References genEllipticPath(), initEllipse(), pointf_s::x, and pointf_s::y.

Referenced by wedgedEllipse().

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

◆ endPath()

static void endPath ( bezier_path_t *  polypath)
static

Definition at line 194 of file ellipse.c.

References lineTo(), pointf_s::x, and pointf_s::y.

Referenced by find_longest_path(), and genEllipticPath().

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

◆ estimateError()

static double estimateError ( ellipse_t ep,
double  etaA,
double  etaB 
)
static

Definition at line 145 of file ellipse.c.

References ellipse_t::a, ellipse_t::b, coeffs3High, coeffs3Low, RationalFunction, and safety3.

Referenced by genEllipticPath().

Here is the caller graph for this function:

◆ genEllipticPath()

static Ppolyline_t * genEllipticPath ( ellipse_t ep)
static

Definition at line 204 of file ellipse.c.

References ellipse_t::a, alpha, ellipse_t::b, curveTo(), ellipse_t::cx, ellipse_t::cy, endPath(), estimateError(), ellipse_t::eta1, ellipse_t::eta2, gv_alloc(), lineTo(), M_PI, moveTo(), Ppoly_t::pn, and Ppoly_t::ps.

Referenced by ellipticWedge().

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

◆ initEllipse()

static void initEllipse ( ellipse_t ep,
double  cx,
double  cy,
double  a,
double  b,
double  lambda1,
double  lambda2 
)
static

Definition at line 70 of file ellipse.c.

References ellipse_t::a, ellipse_t::b, ellipse_t::cx, ellipse_t::cy, ellipse_t::eta1, ellipse_t::eta2, M_PI, and TWOPI.

Referenced by ellipticWedge().

Here is the caller graph for this function:

◆ lineTo()

static void lineTo ( bezier_path_t *  polypath,
double  x,
double  y 
)
static

Definition at line 189 of file ellipse.c.

References curveTo(), pointf_s::x, and pointf_s::y.

Referenced by endPath(), and genEllipticPath().

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

◆ moveTo()

static void moveTo ( bezier_path_t *  polypath,
double  x,
double  y 
)
static

Definition at line 178 of file ellipse.c.

Referenced by genEllipticPath().

Here is the caller graph for this function:

Variable Documentation

◆ coeffs3High

erray_t coeffs3High
static
Initial value:
= {
{
{0.0899116, -19.2349, -4.11711, 0.183362},
{0.138148, -1.45804, 1.32044, 1.38474},
{0.230903, -0.450262, 0.219963, 0.414038},
{0.0590565, -0.101062, 0.0430592, 0.0204699}
},
{
{0.0164649, 9.89394, 0.0919496, 0.00760802},
{0.0191603, -0.0322058, 0.0134667, -0.0825018},
{0.0156192, -0.017535, 0.00326508, -0.228157},
{-0.0236752, 0.0405821, -0.0173086, 0.176187}
}
}

Definition at line 113 of file ellipse.c.

Referenced by estimateError().

◆ coeffs3Low

erray_t coeffs3Low
static
Initial value:
= {
{
{3.85268, -21.229, -0.330434, 0.0127842},
{-1.61486, 0.706564, 0.225945, 0.263682},
{-0.910164, 0.388383, 0.00551445, 0.00671814},
{-0.630184, 0.192402, 0.0098871, 0.0102527}
},
{
{-0.162211, 9.94329, 0.13723, 0.0124084},
{-0.253135, 0.00187735, 0.0230286, 0.01264},
{-0.0695069, -0.0437594, 0.0120636, 0.0163087},
{-0.0328856, -0.00926032, -0.00173573, 0.00527385}
}
}

Definition at line 95 of file ellipse.c.

Referenced by estimateError().

◆ safety3

double safety3[]
static
Initial value:
= {
0.001, 4.98, 0.207, 0.0067
}

Definition at line 130 of file ellipse.c.

Referenced by estimateError().