Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
bezier-utils-test.cpp File Reference

Go to the source code of this file.

Functions

static bool range_approx_equal (double const a[], double const b[], unsigned len)
 
template<class T >
static bool range_equal (T const a[], T const b[], unsigned len)
 
bool point_approx_equal (Geom::Point const &a, Geom::Point const &b, double const eps)
 
static double square (double const x)
 
static void compare_ctlpts (Point const est_b[], Point const exp_est_b[])
 Determine whether the found control points are the same as previously found on some developer's machine.
 
static void compare_rms (Point const est_b[], double const t[], Point const d[], unsigned const n, double const exp_rms_error)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ compare_ctlpts()

static void compare_ctlpts ( Point const  est_b[],
Point const  exp_est_b[] 
)
static

Determine whether the found control points are the same as previously found on some developer's machine.

Doesn't call utest__fail, just writes a message to stdout for diagnostic purposes: the most important test is that the root-mean-square of errors in the estimation are low rather than that the control points found are the same.

Definition at line 40 of file bezier-utils-test.cpp.

Referenced by main().

◆ compare_rms()

static void compare_rms ( Point const  est_b[],
double const  t[],
Point const  d[],
unsigned const  n,
double const  exp_rms_error 
)
static

Definition at line 66 of file bezier-utils-test.cpp.

References dot().

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ point_approx_equal()

bool point_approx_equal ( Geom::Point const &  a,
Geom::Point const &  b,
double const  eps 
)
inline

Definition at line 24 of file bezier-utils-test.cpp.

References Geom::X, and Geom::Y.

Referenced by main().

◆ range_approx_equal()

static bool range_approx_equal ( double const  a[],
double const  b[],
unsigned  len 
)
static

Definition at line 315 of file bezier-utils-test.cpp.

References len.

Referenced by main().

◆ range_equal()

template<class T >
static bool range_equal ( T const  a[],
T const  b[],
unsigned  len 
)
static

Definition at line 15 of file bezier-utils-test.cpp.

References len.

Referenced by main().

◆ square()