Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom Namespace Reference

Various utility functions. More...

Namespaces

namespace  BezierFitter
 
namespace  detail
 
namespace  Interpolate
 
namespace  NL
 
namespace  PathInternal
 
namespace  SL
 

Classes

struct  AddableConcept
 
class  Affine
 3x3 matrix representing an affine transformation. More...
 
class  Angle
 Wrapper for angular values. More...
 
class  AngleInterval
 Directed angular interval. More...
 
struct  Aspect
 Structure that specifies placement of within a viewport. More...
 
class  Bezier
 Polynomial in Bernstein-Bezier basis. More...
 
class  BezierCurve
 Two-dimensional Bezier curve of arbitrary order. More...
 
class  BezierCurveN
 Bezier curve with compile-time specified order. More...
 
class  BezierCurveN< 0 >
 
class  BinomialCoefficient
 Class for calculating and accessing a row of Pascal's triangle. More...
 
class  CairoPathSink
 Output paths to a Cairo drawing context. More...
 
class  Circle
 Set of all points at a fixed distance from the center. More...
 
class  CLIPPER_CLASS
 
class  ContinuityError
 
class  ConvexHull
 Convex hull based on the Andrew's monotone chain algorithm. More...
 
struct  CoordTraits
 Traits class used with coordinate types. More...
 
struct  CoordTraits< Coord >
 
struct  CoordTraits< IntCoord >
 
struct  CoordTraits< WrappedPyObject >
 
struct  Crosser
 
struct  Crossing
 
struct  CrossingOrder
 
struct  CrossingTraits
 
struct  CrossingTraits< Path >
 
class  Curve
 Abstract continuous curve on a plane defined on [0,1]. More...
 
class  D2
 Adaptor that creates 2D functions from 1D ones. More...
 
struct  D2Traits
 
class  Eigen
 Given a matrix (ignoring the translation) this returns the eigen values and vectors. More...
 
class  Ellipse
 Set of points with a constant sum of distances from two foci. More...
 
class  EllipticalArc
 Elliptical arc curve. More...
 
struct  EmptyClass
 
struct  EqualityComparableConcept
 
class  Exception
 Base exception class, all 2geom exceptions should be derived from this one. More...
 
struct  FragmentConcept
 
class  GenericInterval
 A range of numbers which is never empty. More...
 
class  GenericOptInterval
 A range of numbers that can be empty. More...
 
class  GenericOptRect
 Axis-aligned generic rectangle that can be empty. More...
 
class  GenericRect
 Axis aligned, non-empty, generic rectangle. More...
 
struct  GetAxis
 Axis extraction functor. More...
 
class  HatOf
 
class  HShear
 Horizontal shearing. More...
 
class  InfinitelyManySolutions
 
class  InfiniteSolutions
 
class  Intersection
 Intersection between two shapes. More...
 
class  Interval
 Range of real numbers that is never empty. More...
 
class  IntPoint
 Two-dimensional point with integer coordinates. More...
 
class  InvariantsViolation
 
class  Line
 Infinite line on a plane. More...
 
class  Linear
 Function that interpolates linearly between two values. More...
 
class  Linear2d
 
class  LinearN
 
class  LinearN< 0 >
 
class  LinearOf
 
class  LogicalError
 
struct  MonoCrosser
 
class  MultiDegree
 MultiDegree: More...
 
struct  MultipliableNoncommutative
 Noncommutative multiplication helper. More...
 
struct  MultiplicableConcept
 
struct  NearConcept
 
class  NotImplemented
 
class  NotInvertible
 
struct  NullIterator
 Null output iterator Use this if you want to discard a result returned through an output iterator. More...
 
struct  OffsetableConcept
 
class  OptInterval
 Range of real numbers that can be empty. More...
 
class  OptRect
 Axis-aligned rectangle that can be empty. More...
 
class  Parallelogram
 Paralellogram, representing a linear transformation of a rectangle. More...
 
class  Path
 Sequence of contiguous curves, aka spline. More...
 
class  PathBuilder
 Store paths to a PathVector. More...
 
struct  PathExtrema
 Stores information about the extremum points on a path, with respect to one of the coordinate axes. More...
 
class  PathIntersectionGraph
 Intermediate data for computing Boolean operations on paths. More...
 
class  PathInterval
 Contiguous subset of the path's parameter domain. More...
 
class  PathIteratorSink
 Store paths to an output iterator. More...
 
class  PathSink
 Callback interface for processing path data. More...
 
struct  PathTime
 Generalized time value in the path. More...
 
class  PathVector
 Sequence of subpaths. More...
 
struct  PathVectorTime
 Generalized time value in the path vector. More...
 
class  pedantic_vector
 
class  Piecewise
 Function defined as discrete pieces. More...
 
class  PlanarGraph
 Planar graph - a graph geometrically embedded in the plane. More...
 
class  Point
 Two-dimensional point that doubles as a vector. More...
 
class  Poly
 Polynomial in canonical (monomial) basis. More...
 
class  RangeError
 
class  RatQuad
 
class  Ray
 Straight ray from a specific point to infinity. More...
 
class  Rect
 Axis aligned, non-empty rectangle. More...
 
class  RedBlack
 
class  RedBlackTree
 
struct  ResultTraits
 
struct  ResultTraits< double >
 
struct  ResultTraits< Point >
 
class  Rotate
 Rotation around the origin. More...
 
class  RTree
 
class  RTreeNode
 
class  RTreeRecord_Leaf
 
class  RTreeRecord_NonLeaf
 
class  SBasis
 Polynomial in symmetric power basis. More...
 
class  SBasis2d
 
class  SBasisCurve
 Symmetric power basis curve. More...
 
class  SBasisN
 Polynomials of n variables, written in SBasis form. More...
 
class  SBasisN< 0 >
 
class  SBasisOf
 
struct  ScalableConcept
 
class  Scale
 Scaling from the origin. More...
 
struct  ShapeConcept
 
struct  ShapeTraits
 
struct  ShapeTraits< Circle >
 
struct  ShapeTraits< Path >
 
struct  ShapeTraits< PathVector >
 
class  ShearBase
 Common base for shearing transforms. More...
 
struct  SimpleCrosser
 
struct  SmashIntersection
 
class  SVGPathGenerator
 
struct  SVGPathParseError
 
class  SVGPathParser
 Read SVG path data and feed it to a PathSink. More...
 
class  SVGPathWriter
 Serialize paths to SVG path data strings. More...
 
class  Sweeper
 Generic sweepline algorithm. More...
 
class  SweepVector
 
struct  TransformConcept
 Type requirements for transforms. More...
 
class  TransformOperations
 Base template for transforms. More...
 
class  Translate
 Translation by a vector. More...
 
class  TriOf
 
class  VShear
 Vertical shearing. More...
 
class  WrappedPyObject
 
class  xAx
 
class  Zoom
 Combination of a translation and uniform scale. More...
 

Concepts

concept  EdgeLabelConcept
 

Typedefs

typedef BezierCurveN< 1 > LineSegment
 Line segment.
 
typedef BezierCurveN< 2 > QuadraticBezier
 Quadratic (order 2) Bezier curve.
 
typedef BezierCurveN< 3 > CubicBezier
 Cubic (order 3) Bezier curve.
 
using Coord = double
 Floating point type used to store coordinates.
 
using IntCoord = int
 Type used for integral coordinates.
 
typedef std::optional< CrossingOptCrossing
 
typedef std::vector< CrossingCrossings
 
typedef std::vector< CrossingsCrossingSet
 
typedef Intersection CurveIntersection
 
using IntInterval = GenericInterval< IntCoord >
 Range of integers that is never empty.
 
using OptIntInterval = GenericOptInterval< IntCoord >
 Range of integers that can be empty.
 
typedef GenericRect< IntCoordIntRect
 
typedef GenericOptRect< IntCoordOptIntRect
 
typedef Intersection ShapeIntersection
 
typedef Geom::LinearOf< double > Linear
 
typedef Geom::SBasisOf< double > SBasis
 
typedef SimpleCrosser DefaultCrosser
 
typedef std::back_insert_iterator< PathVectorSubpathInserter
 
typedef Intersection< PathTimePathIntersection
 
typedef Intersection< PathVectorTimePathVectorIntersection
 
typedef PathVectorIntersection PVIntersection
 Alias to save typing.
 
using ErrorCode = int
 
typedef GenericInterval< WrappedPyObjectPyInterval
 
typedef GenericOptInterval< WrappedPyObjectPyOptInterval
 
typedef GenericRect< WrappedPyObjectPyRect
 
typedef GenericOptRect< WrappedPyObjectPyOptRect
 
typedef D2< WrappedPyObjectPyPoint
 
typedef ::testing::Types< Coord, IntCoordCoordTypes
 

Enumerations

enum  Dim2 { X = 0 , Y = 1 }
 2D axis enumeration (X or Y). More...
 
enum  enum_add_to_group { ADD_TO_GROUP_A = 0 , ADD_TO_GROUP_B }
 
enum  enum_split_strategy { QUADRATIC_SPIT = 0 , LINEAR_COST , TOTAL_STRATEGIES }
 
enum  Align {
  ALIGN_NONE , ALIGN_XMIN_YMIN , ALIGN_XMID_YMIN , ALIGN_XMAX_YMIN ,
  ALIGN_XMIN_YMID , ALIGN_XMID_YMID , ALIGN_XMAX_YMID , ALIGN_XMIN_YMAX ,
  ALIGN_XMID_YMAX , ALIGN_XMAX_YMAX
}
 Values for the <align> parameter of preserveAspectRatio. More...
 
enum  Expansion { EXPANSION_MEET , EXPANSION_SLICE }
 Values for the <meetOrSlice> parameter of preserveAspectRatio. More...
 
enum  Errors : ErrorCode { GEOM_ERR_INTERSECGRAPH }
 
enum  IntersectorKind { intersects = 0 , parallel , coincident , no_intersection }
 
enum  NodeType { NODE_NONE , NODE_CUSP , NODE_SMOOTH , NODE_SYMM }
 What kind of node is this? This is the value for the node->type field. More...
 

Functions

Affine from_basis (Point const &x_basis, Point const &y_basis, Point const &offset)
 Creates a Affine given an axis and origin point.
 
Affine elliptic_quadratic_form (Affine const &m)
 
Affine identity ()
 Create an identity matrix.
 
bool are_near (Affine const &a1, Affine const &a2, Coord eps=EPSILON)
 
Angle distance (Angle const &a, Angle const &b)
 
void find_intersections (std::vector< std::pair< double, double > > &xs, D2< Bezier > const &A, D2< Bezier > const &B, double precision=EPSILON)
 
void find_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, D2< SBasis > const &B, double precision=EPSILON)
 
void find_intersections (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON)
 
void find_self_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, double precision=EPSILON)
 
void find_self_intersections (std::vector< std::pair< double, double > > &xs, D2< Bezier > const &A, double precision=EPSILON)
 
void find_intersections_bezier_clipping (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON)
 
void subdivide (D2< Bezier > const &a, D2< Bezier > const &b, std::vector< std::pair< double, double > > const &xs, std::vector< D2< Bezier > > &av, std::vector< D2< Bezier > > &bv)
 
void find_collinear_normal (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON)
 
void polish_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, D2< SBasis > const &B)
 
double hausdorfl (D2< SBasis > &A, D2< SBasis > const &B, double m_precision, double *a_t=NULL, double *b_t=NULL)
 Compute the Hausdorf distance from A to B only.
 
double hausdorf (D2< SBasis > &A, D2< SBasis > const &B, double m_precision, double *a_t=NULL, double *b_t=NULL)
 Compute the symmetric Hausdorf distance.
 
bool non_collinear_segments_intersect (const Point &A, const Point &B, const Point &C, const Point &D)
 Check if two line segments intersect.
 
Point middle_point (LineSegment const &_segment)
 
Coord length (LineSegment const &seg)
 
Coord bezier_length (std::vector< Point > const &points, Coord tolerance)
 Compute the length of a bezier curve given by a vector of its control points.
 
Coord bezier_length (Point a0, Point a1, Point a2, Coord tolerance)
 Compute the length of a quadratic bezier curve given by its control points.
 
Coord bezier_length (Point a0, Point a1, Point a2, Point a3, Coord tolerance)
 Compute the length of a cubic bezier curve given by its control points.
 
SBasis bezier_to_sbasis (Coord const *handles, unsigned order)
 
template<typename T >
D2< SBasishandles_to_sbasis (T const &handles, unsigned order)
 
Point bezier_pt (unsigned const degree, Point const V[], double const t)
 Evaluate a Bezier curve at parameter value t.
 
int bezier_fit_cubic (Point bezier[], Point const data[], int len, double error)
 
int bezier_fit_cubic_r (Point bezier[], Point const data[], int const len, double const error, unsigned const max_beziers)
 Fit a multi-segment Bezier curve to a set of digitized points, with possible weedout of identical points and NaNs.
 
int bezier_fit_cubic_full (Point bezier[], int split_points[], Point const data[], int const len, Point const &tHat1, Point const &tHat2, double const error, unsigned const max_beziers)
 Fit a multi-segment Bezier curve to a set of digitized points, without possible weedout of identical points and NaNs.
 
Point darray_left_tangent (Point const d[], unsigned const len)
 Estimate the (forward) tangent at point d[first + 0.5].
 
Point darray_left_tangent (Point const d[], unsigned const len, double const tolerance_sq)
 Estimate the (forward) tangent at point d[0].
 
Point darray_right_tangent (Point const d[], unsigned const len, double const tolerance_sq)
 Estimates the (backward) tangent at d[last].
 
template<typename iterator >
static void cubic_bezier_poly_coeff (iterator b, Point *pc)
 
template<typename T >
bernstein_value_at (double t, T const *c_, unsigned n)
 Compute the value of a Bernstein-Bezier polynomial.
 
template<typename T >
casteljau_subdivision (double t, T const *v, T *left, T *right, unsigned order)
 Perform Casteljau subdivision of a Bezier polynomial.
 
void bezier_to_sbasis (SBasis &sb, Bezier const &bz)
 Changes the basis of p to be sbasis.
 
Bezier operator* (Bezier const &f, Bezier const &g)
 
Bezier multiply (Bezier const &f, Bezier const &g)
 
Bezier reverse (const Bezier &a)
 
Bezier portion (const Bezier &a, double from, double to)
 
std::vector< Pointbezier_points (const D2< Bezier > &a)
 
Bezier derivative (Bezier const &a)
 
Bezier integral (Bezier const &a)
 
OptInterval bounds_fast (Bezier const &b)
 
OptInterval bounds_exact (Bezier const &b)
 
OptInterval bounds_local (Bezier const &b, OptInterval const &i)
 
void bezier_expand_to_image (Interval &range, Coord x0, Coord x1, Coord x2)
 Expand an interval to the image of a Bézier-Bernstein polynomial, assuming it already contains the initial point x0.
 
void bezier_expand_to_image (Interval &range, Coord x0, Coord x1, Coord x2, Coord x3)
 
std::ostream & operator<< (std::ostream &os, const Bezier &b)
 
template<typename T >
constexpr void binomial_increment_n (T &b, int n, int k)
 Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n + 1, k).
 
template<typename T >
constexpr void binomial_decrement_n (T &b, int n, int k)
 Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n - 1, k).
 
template<typename T >
constexpr void binomial_increment_k (T &b, int n, int k)
 Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k + 1).
 
template<typename T >
constexpr void binomial_decrement_k (T &b, int n, int k)
 Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k - 1).
 
template<typename T >
constexpr T choose (unsigned n, unsigned k)
 Calculate the (n, k)th binomial coefficient.
 
bool are_near (Circle const &a, Circle const &b, Coord eps=EPSILON)
 
std::ostream & operator<< (std::ostream &out, Circle const &c)
 
template<typename T >
portion (const T &t, const Interval &i)
 
std::vector< Pointintersect (const xAx &C1, const xAx &C2)
 
bool clip (std::vector< RatQuad > &rq, const xAx &cs, const Rect &R)
 
std::ostream & operator<< (std::ostream &out_file, const xAx &x)
 
std::ostream & operator<< (std::ostream &out, Geom::ConvexHull const &hull)
 Output operator for convex hulls.
 
constexpr Dim2 other_dimension (Dim2 d)
 Get the other (perpendicular) dimension.
 
constexpr Coord infinity ()
 Get a value representing infinity.
 
bool are_near (Coord a, Coord b, double eps=EPSILON)
 Nearness predicate for values.
 
bool rel_error_bound (Coord a, Coord b, double eps=EPSILON)
 
constexpr Coord lerp (Coord t, Coord a, Coord b)
 Numerically stable linear interpolation.
 
template<typename C >
std::vector< Rectbounds (C const &a)
 
std::vector< Rectbounds (Path const &a)
 
void sort_crossings (Crossings &cr, unsigned ix)
 
void merge_crossings (Crossings &a, Crossings &b, unsigned i)
 
void offset_crossings (Crossings &cr, double a, double b)
 
Crossings reverse_ta (Crossings const &cr, std::vector< double > max)
 
Crossings reverse_tb (Crossings const &cr, unsigned split, std::vector< double > max)
 
CrossingSet reverse_ta (CrossingSet const &cr, unsigned split, std::vector< double > max)
 
CrossingSet reverse_tb (CrossingSet const &cr, unsigned split, std::vector< double > max)
 
void clean (Crossings &cr_a, Crossings &cr_b)
 
void delete_duplicates (Crossings &crs)
 
Coord nearest_time (Point const &p, Curve const &c)
 
Curvenew_clone (Curve const &c)
 
template<typename T >
D2< T > reverse (const D2< T > &a)
 
template<typename T >
D2< T > portion (const D2< T > &a, Coord f, Coord t)
 
template<typename T >
D2< T > portion (const D2< T > &a, Interval i)
 
template<typename T >
bool operator== (D2< T > const &a, D2< T > const &b)
 
template<typename T >
bool operator!= (D2< T > const &a, D2< T > const &b)
 
template<typename T >
bool are_near (D2< T > const &a, D2< T > const &b, double tol)
 
template<typename T >
D2< T > operator+ (D2< T > const &a, D2< T > const &b)
 
template<typename T >
D2< T > operator- (D2< T > const &a, D2< T > const &b)
 
template<typename T >
D2< T > operator+= (D2< T > &a, D2< T > const &b)
 
template<typename T >
D2< T > operator-= (D2< T > &a, D2< T > const &b)
 
template<typename T >
D2< T > operator- (D2< T > const &a)
 
template<typename T >
D2< T > operator* (D2< T > const &a, Point const &b)
 
template<typename T >
D2< T > operator/ (D2< T > const &a, Point const &b)
 
template<typename T >
D2< T > operator*= (D2< T > &a, Point const &b)
 
template<typename T >
D2< T > operator/= (D2< T > &a, Point const &b)
 
template<typename T >
D2< T > operator* (D2< T > const &a, double b)
 
template<typename T >
D2< T > operator*= (D2< T > &a, double b)
 
template<typename T >
D2< T > operator/ (D2< T > const &a, double b)
 
template<typename T >
D2< T > operator/= (D2< T > &a, double b)
 
template<typename T >
D2< T > operator* (D2< T > const &v, Affine const &m)
 
template<typename T >
D2< T > operator* (D2< T > const &a, T const &b)
 
template<typename T >
D2< T > operator+ (D2< T > const &a, Point b)
 
template<typename T >
D2< T > operator- (D2< T > const &a, Point b)
 
template<typename T >
D2< T > operator+= (D2< T > &a, Point b)
 
template<typename T >
D2< T > operator-= (D2< T > &a, Point b)
 
template<typename T >
dot (D2< T > const &a, D2< T > const &b)
 
template<typename T >
D2< T > rot90 (D2< T > const &a)
 
template<typename T >
D2< T > compose (D2< T > const &a, T const &b)
 
template<typename T >
D2< T > compose_each (D2< T > const &a, D2< T > const &b)
 
template<typename T >
D2< T > compose_each (T const &a, D2< T > const &b)
 
template<typename T >
D2< T > derivative (D2< T > const &a)
 
template<typename T >
D2< T > integral (D2< T > const &a)
 
template<typename T >
std::ostream & operator<< (std::ostream &out_file, const Geom::D2< T > &in_d2)
 A function to print out the Point.
 
template<typename T >
OptRect bounds_fast (const D2< T > &a)
 
template<typename T >
OptRect bounds_exact (const D2< T > &a)
 
template<typename T >
OptRect bounds_local (const D2< T > &a, const OptInterval &t)
 
D2< SBasiscompose (D2< SBasis > const &a, SBasis const &b)
 
SBasis L2 (D2< SBasis > const &a, unsigned k)
 
double L2 (D2< double > const &a)
 
D2< SBasismultiply (Linear const &a, D2< SBasis > const &b)
 
D2< SBasisoperator* (Linear const &a, D2< SBasis > const &b)
 
D2< SBasismultiply (SBasis const &a, D2< SBasis > const &b)
 
D2< SBasisoperator* (SBasis const &a, D2< SBasis > const &b)
 
D2< SBasistruncate (D2< SBasis > const &a, unsigned terms)
 
unsigned sbasis_size (D2< SBasis > const &a)
 
double tail_error (D2< SBasis > const &a, unsigned tail)
 
Piecewise< D2< SBasis > > sectionize (D2< Piecewise< SBasis > > const &a)
 
D2< Piecewise< SBasis > > make_cuts_independent (Piecewise< D2< SBasis > > const &a)
 
Piecewise< D2< SBasis > > rot90 (Piecewise< D2< SBasis > > const &a)
 
Piecewise< SBasisdot (Piecewise< D2< SBasis > > const &a, Piecewise< D2< SBasis > > const &b)
 
Piecewise< SBasisdot (Piecewise< D2< SBasis > > const &a, Point const &b)
 
Piecewise< SBasiscross (Piecewise< D2< SBasis > > const &a, Piecewise< D2< SBasis > > const &b)
 
Piecewise< D2< SBasis > > operator* (Piecewise< D2< SBasis > > const &a, Affine const &m)
 
Piecewise< D2< SBasis > > force_continuity (Piecewise< D2< SBasis > > const &f, double tol=0, bool closed=false)
 
std::vector< Piecewise< D2< SBasis > > > fuse_nearby_ends (std::vector< Piecewise< D2< SBasis > > > const &f, double tol=0)
 
std::vector< Geom::Piecewise< Geom::D2< Geom::SBasis > > > split_at_discontinuities (Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwsbin, double tol=.0001)
 
Point unitTangentAt (D2< SBasis > const &a, Coord t, unsigned n=3)
 
OptRect bounds_fast (D2< SBasis > const &s, unsigned order=0)
 
OptRect bounds_local (D2< SBasis > const &s, OptInterval i, unsigned order=0)
 
std::vector< Intervallevel_set (D2< SBasis > const &f, Rect region)
 
std::vector< Intervallevel_set (D2< SBasis > const &f, Point p, double tol)
 
std::vector< std::vector< Interval > > level_sets (D2< SBasis > const &f, std::vector< Rect > regions)
 
std::vector< std::vector< Interval > > level_sets (D2< SBasis > const &f, std::vector< Point > pts, double tol)
 
template<typename C >
std::ostream & operator<< (std::ostream &out, GenericInterval< C > const &I)
 
template<typename C >
std::ostream & operator<< (std::ostream &out, GenericOptInterval< C > const &I)
 
template<typename C >
std::ostream & operator<< (std::ostream &out, GenericRect< C > const &r)
 
template<typename C >
std::ostream & operator<< (std::ostream &out, GenericOptRect< C > const &r)
 
std::optional< Geom::LineSegmentrect_line_intersect (Geom::Rect &r, Geom::LineSegment ls)
 Determine whether & where an (infinite) line intersects a rectangle.
 
int centroid (std::vector< Geom::Point > const &p, Geom::Point &centroid, double &area)
 polyCentroid: Calculates the centroid (xCentroid, yCentroid) and area of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]).
 
OptIntRect operator& (IntRect const &a, IntRect const &b)
 
OptIntRect intersect (IntRect const &a, IntRect const &b)
 
OptIntRect intersect (OptIntRect const &a, OptIntRect const &b)
 
IntRect unify (IntRect const &a, IntRect const &b)
 
OptIntRect unify (OptIntRect const &a, OptIntRect const &b)
 
std::ostream & operator<< (std::ostream &os, PathIntersectionGraph const &pig)
 Format the PathIntersectionGraph for output.
 
template<typename A , typename B >
std::vector< Intersection< A, B > > transpose (std::vector< Intersection< B, A > > const &in)
 
template<typename T >
void transpose_in_place (std::vector< Intersection< T, T > > &xs)
 
Interval unify (Interval const &a, Interval const &b)
 
OptInterval intersect (Interval const &a, Interval const &b)
 
void filter_line_segment_intersections (std::vector< ShapeIntersection > &xs, bool a=false, bool b=true)
 Removes intersections outside of the unit interval.
 
void filter_ray_intersections (std::vector< ShapeIntersection > &xs, bool a=false, bool b=true)
 
bool are_near (Point const &p, Line const &line, double eps=EPSILON)
 
bool are_parallel (Line const &l1, Line const &l2, double eps=EPSILON)
 
double angle_between (Line const &l1, Line const &l2)
 
double distance (Point const &p, LineSegment const &seg)
 
bool are_near (Point const &p, LineSegment const &seg, double eps=EPSILON)
 
Line make_orthogonal_line (Point const &p, Line const &line)
 
Line make_parallel_line (Point const &p, Line const &line)
 
Line make_bisector_line (LineSegment const &_segment)
 
Line make_angle_bisector_line (Point const &A, Point const &O, Point const &B)
 
Point projection (Point const &p, Line const &line)
 
LineSegment projection (LineSegment const &seg, Line const &line)
 
std::optional< LineSegmentclip (Line const &l, Rect const &r)
 
OptCrossing intersection (Ray const &r1, Line const &l2)
 
OptCrossing intersection (Line const &l1, Ray const &r2)
 
OptCrossing intersection (LineSegment const &ls1, Line const &l2)
 
OptCrossing intersection (Line const &l1, LineSegment const &ls2)
 
OptCrossing intersection (LineSegment const &ls1, Ray const &r2)
 
OptCrossing intersection (Ray const &r1, LineSegment const &ls2)
 
OptCrossing intersection (Line const &l1, Line const &l2)
 
OptCrossing intersection (Ray const &r1, Ray const &r2)
 
OptCrossing intersection (LineSegment const &ls1, LineSegment const &ls2)
 
Linear reverse (Linear const &a)
 
Linear portion (Linear const &a, Coord from, Coord to)
 
template<class T >
int sgn (const T &x)
 Sign function - indicates the sign of a numeric type.
 
template<class T >
sqr (const T &x)
 
template<class T >
cube (const T &x)
 
template<class T >
const T & between (const T &min, const T &max, const T &x)
 Between function - returns true if a number x is within a range: (min < x) && (max > x).
 
double decimal_round (double x, int p)
 Returns x rounded to the nearest multiple of \(10^{p}\).
 
void sincos (double angle, double &sin_, double &cos_)
 Simultaneously compute a sine and a cosine of the same angle.
 
template<size_t N>
int rescale_homogenous (std::array< double, N > &values)
 Scale the doubles in the passed array to make them "reasonably large".
 
double nearest_time (Point const &p, Point const &A, Point const &v)
 
Coord nearest_time (Point const &p, D2< Bezier > const &bez, Coord from=0, Coord to=1)
 
double nearest_time (Point const &p, D2< SBasis > const &c, D2< SBasis > const &deriv, double from=0, double to=1)
 
double nearest_time (Point const &p, D2< SBasis > const &c, double from=0, double to=1)
 
std::vector< double > all_nearest_times (Point const &p, D2< SBasis > const &c, D2< SBasis > const &dc, double from=0, double to=1)
 
std::vector< double > all_nearest_times (Point const &p, D2< SBasis > const &c, double from=0, double to=1)
 
double nearest_time (Point const &p, Piecewise< D2< SBasis > > const &c, double from, double to)
 
double nearest_time (Point const &p, Piecewise< D2< SBasis > > const &c)
 
std::vector< double > all_nearest_times (Point const &p, Piecewise< D2< SBasis > > const &c, double from, double to)
 
std::vector< double > all_nearest_times (Point const &p, Piecewise< D2< SBasis > > const &c)
 
SBasis chebyshev_approximant (double(*f)(double, void *), int order, Interval in, void *p=0)
 
SBasis chebyshev_approximant_interpolating (double(*f)(double, void *), int order, Interval in, void *p=0)
 
SBasis chebyshev (unsigned n)
 
std::vector< SmashIntersectionsmash_intersect (D2< SBasis > const &a, D2< SBasis > const &b, double tol)
 
std::vector< SmashIntersectionmonotonic_smash_intersect (D2< SBasis > const &a, D2< SBasis > const &b, double tol)
 
std::vector< IntervalmonotonicSplit (D2< SBasis > const &p)
 
template<typename T >
lerp (double t, T a, T b)
 
template<typename T >
LinearOf< T > reverse (LinearOf< T > const &a)
 
template<typename T >
LinearOf< T > operator+ (LinearOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
LinearOf< T > operator- (LinearOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
LinearOf< T > & operator+= (LinearOf< T > &a, LinearOf< T > const &b)
 
template<typename T >
LinearOf< T > & operator-= (LinearOf< T > &a, LinearOf< T > const &b)
 
template<typename T >
LinearOf< T > operator+ (LinearOf< T > const &a, double b)
 
template<typename T >
LinearOf< T > operator- (LinearOf< T > const &a, double b)
 
template<typename T >
LinearOf< T > & operator+= (LinearOf< T > &a, double b)
 
template<typename T >
LinearOf< T > & operator-= (LinearOf< T > &a, double b)
 
template<typename T >
bool operator== (LinearOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
bool operator!= (LinearOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
LinearOf< T > operator- (LinearOf< T > const &a)
 
template<typename T >
LinearOf< T > operator* (LinearOf< T > const &a, double b)
 
template<typename T >
LinearOf< T > operator/ (LinearOf< T > const &a, double b)
 
template<typename T >
LinearOf< T > operator*= (LinearOf< T > &a, double b)
 
template<typename T >
LinearOf< T > operator/= (LinearOf< T > &a, double b)
 
double lerpppp (double t, double a, double b)
 
Linear toLinear (LinearN< 1 > f)
 
template<unsigned n>
LinearN< n > operator+ (LinearN< n > const &a, LinearN< n > const &b)
 
template<unsigned n>
LinearN< n > operator- (LinearN< n > const &a, LinearN< n > const &b)
 
template<unsigned n>
LinearN< n > & operator+= (LinearN< n > &a, LinearN< n > const &b)
 
template<unsigned n>
LinearN< n > & operator-= (LinearN< n > &a, LinearN< n > const &b)
 
template<unsigned n>
LinearN< n > operator+ (LinearN< n > const &a, double b)
 
template<unsigned n>
LinearN< n > operator- (LinearN< n > const &a, double b)
 
template<unsigned n>
LinearN< n > & operator+= (LinearN< n > &a, double b)
 
template<unsigned n>
LinearN< n > & operator-= (LinearN< n > &a, double b)
 
template<unsigned n>
bool operator== (LinearN< n > const &a, LinearN< n > const &b)
 
template<unsigned n>
bool operator!= (LinearN< n > const &a, LinearN< n > const &b)
 
template<unsigned n>
LinearN< n > operator- (LinearN< n > const &a)
 
template<unsigned n>
LinearN< n > operator* (LinearN< n > const &a, double b)
 
template<unsigned n>
LinearN< n > operator/ (LinearN< n > const &a, double b)
 
template<unsigned n>
LinearN< n > operator*= (LinearN< n > &a, double b)
 
template<unsigned n>
LinearN< n > operator/= (LinearN< n > &a, double b)
 
template<unsigned n>
void setToVariable (LinearN< n > &x, unsigned k)
 
template<unsigned n>
std::ostream & operator<< (std::ostream &out_file, const LinearN< n > &bo)
 
OptInterval bounds_exact (SBasis const &a)
 
OptInterval bounds_fast (SBasis const &a, int order=0)
 
OptInterval bounds_local (SBasis const &a, const OptInterval &t, int order=0)
 
std::vector< double > roots (SBasis const &s)
 
std::vector< std::vector< double > > multi_roots (SBasis const &f, std::vector< double > const &levels, double htol=1e-7, double vtol=1e-7, double a=0, double b=1)
 
template<typename T >
SBasisOf< T > reverse (SBasisOf< T > const &a)
 
template<typename T >
SBasisOf< T > operator- (const SBasisOf< T > &p)
 
template<typename T >
SBasisOf< T > operator* (SBasisOf< T > const &a, double k)
 
template<typename T >
SBasisOf< T > operator* (double k, SBasisOf< T > const &a)
 
template<typename T >
SBasisOf< T > operator/ (SBasisOf< T > const &a, double k)
 
template<typename T >
SBasisOf< T > & operator*= (SBasisOf< T > &a, double b)
 
template<typename T >
SBasisOf< T > & operator/= (SBasisOf< T > &a, double b)
 
template<typename T >
SBasisOf< T > operator+ (const SBasisOf< T > &a, const SBasisOf< T > &b)
 
template<typename T >
SBasisOf< T > operator- (const SBasisOf< T > &a, const SBasisOf< T > &b)
 
template<typename T >
SBasisOf< T > & operator+= (SBasisOf< T > &a, const SBasisOf< T > &b)
 
template<typename T >
SBasisOf< T > & operator-= (SBasisOf< T > &a, const SBasisOf< T > &b)
 
template<typename T >
SBasisOf< T > operator+ (const SBasisOf< T > &a, LinearOf< T > const &b)
 
template<typename T >
SBasisOf< T > operator- (const SBasisOf< T > &a, LinearOf< T > const &b)
 
template<typename T >
SBasisOf< T > & operator+= (SBasisOf< T > &a, const LinearOf< T > &b)
 
template<typename T >
SBasisOf< T > & operator-= (SBasisOf< T > &a, const LinearOf< T > &b)
 
template<typename T >
SBasisOf< T > operator+ (const SBasisOf< T > &a, T b)
 
template<typename T >
SBasisOf< T > operator- (const SBasisOf< T > &a, T b)
 
template<typename T >
SBasisOf< T > & operator+= (SBasisOf< T > &a, T b)
 
template<typename T >
SBasisOf< T > & operator-= (SBasisOf< T > &a, T b)
 
template<typename T >
SBasisOf< T > shift (SBasisOf< T > const &a, int sh)
 
template<typename T >
SBasisOf< T > shift (LinearOf< T > const &a, int sh)
 
template<typename T >
SBasisOf< T > truncate (SBasisOf< T > const &a, unsigned terms)
 
template<typename T >
SBasisOf< T > multiply_add (SBasisOf< T > const &a, SBasisOf< T > const &b, SBasisOf< T > c)
 
template<typename T >
SBasisOf< T > multiply (SBasisOf< T > const &a, SBasisOf< T > const &b)
 
template<typename T >
SBasisOf< T > integral (SBasisOf< T > const &c)
 
template<typename T >
SBasisOf< T > derivative (SBasisOf< T > const &a)
 
template<typename T >
SBasisOf< T > operator* (SBasisOf< T > const &a, SBasisOf< T > const &b)
 
template<typename T >
SBasisOf< T > & operator*= (SBasisOf< T > &a, SBasisOf< T > const &b)
 
template<typename T >
SBasisOf< T > compose (SBasisOf< T > const &a, SBasisOf< T > const &b)
 
template<typename T >
SBasisOf< T > compose (SBasisOf< T > const &a, SBasisOf< T > const &b, unsigned k)
 
template<typename T >
SBasisOf< T > compose (LinearOf< T > const &a, SBasisOf< T > const &b)
 
template<typename T >
SBasisOf< T > compose (SBasisOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
SBasisOf< T > compose (LinearOf< T > const &a, LinearOf< T > const &b)
 
template<typename T >
SBasisOf< T > portion (const SBasisOf< T > &t, double from, double to)
 
template<typename T >
std::ostream & operator<< (std::ostream &out_file, const LinearOf< T > &bo)
 
template<typename T >
std::ostream & operator<< (std::ostream &out_file, const SBasisOf< T > &p)
 
template<unsigned n>
MultiDegree< n > max (MultiDegree< n > const &p, MultiDegree< n > const &q)
 Returns the maximal degree appearing in the two arguments for each variables.
 
template<unsigned n>
MultiDegree< n > operator+ (MultiDegree< n > const &p, MultiDegree< n > const &q)
 
template<unsigned n>
MultiDegree< n > operator+= (MultiDegree< n > const &p, MultiDegree< n > const &q)
 
template<unsigned n>
bool operator<= (MultiDegree< n > const &p, MultiDegree< n > const &q)
 MultiDegree comparison.
 
SBasis toSBasis (SBasisN< 1 > f)
 
template<unsigned n>
SBasisN< n > operator- (const SBasisN< n > &p)
 Returns a function which reverses the domain of a.
 
template<unsigned n>
SBasisN< n > operator* (SBasisN< n > const &a, double c)
 
template<unsigned n>
SBasisN< n > operator* (double k, SBasisN< n > const &a)
 
template<unsigned n>
SBasisN< n > operator/ (SBasisN< n > const &a, double k)
 
template<unsigned n>
SBasisN< n > & operator*= (SBasisN< n > &a, double c)
 
template<unsigned n>
SBasisN< n > & operator/= (SBasisN< n > &a, double b)
 
template<unsigned n>
SBasisN< n > operator+ (const SBasisN< n > &a, const SBasisN< n > &b)
 
template<unsigned n>
SBasisN< n > operator- (const SBasisN< n > &a, const SBasisN< n > &b)
 
template<unsigned n>
SBasisN< n > & operator+= (SBasisN< n > &a, const SBasisN< n > &b)
 
template<unsigned n>
SBasisN< n > & operator-= (SBasisN< n > &a, const SBasisN< n > &b)
 
template<unsigned n>
SBasisN< n > operator+ (const SBasisN< n > &a, LinearN< n > const &b)
 
template<unsigned n>
SBasisN< n > operator- (const SBasisN< n > &a, LinearN< n > const &b)
 
template<unsigned n>
SBasisN< n > & operator+= (SBasisN< n > &a, const LinearN< n > &b)
 
template<unsigned n>
SBasisN< n > & operator-= (SBasisN< n > &a, const LinearN< n > &b)
 
template<unsigned n>
SBasisN< n > operator+ (const SBasisN< n > &a, double b)
 
template<unsigned n>
SBasisN< n > operator- (const SBasisN< n > &a, double b)
 
template<unsigned n>
SBasisN< n > & operator+= (SBasisN< n > &a, double b)
 
template<unsigned n>
SBasisN< n > & operator-= (SBasisN< n > &a, double b)
 
template<unsigned n>
SBasisN< n > shift (SBasisN< n > const &a, MultiDegree< n > sh)
 
template<unsigned n>
SBasisN< n > shift (LinearN< n > const &a, MultiDegree< n > sh)
 
template<unsigned n>
SBasisN< n > shift (LinearN< n > const &a, unsigned sh, unsigned var)
 
template<unsigned n>
SBasisN< n > truncate (SBasisN< n > const &a, unsigned first_size)
 
template<unsigned n>
SBasisN< n > multiply (SBasisN< n > const &a, SBasisN< n > const &b)
 
template<unsigned n>
SBasisN< n > operator* (SBasisN< n > const &a, SBasisN< n > const &b)
 
template<unsigned n>
SBasisN< n > & operator*= (SBasisN< n > &a, SBasisN< n > const &b)
 
template<unsigned m, unsigned n>
SBasisN< m > compose (LinearN< n > const &f, std::vector< SBasisN< m > > const &t, unsigned fixed=0, unsigned flags=0)
 
template<unsigned m, unsigned n>
SBasisN< m > compose (SBasisN< n > const &f, std::vector< SBasisN< m > > const &t, unsigned const k=0, unsigned const idx=0)
 
template<unsigned n>
std::ostream & operator<< (std::ostream &out_file, const MultiDegree< n > &d)
 
template<unsigned n>
std::ostream & operator<< (std::ostream &out_file, const SBasisN< n > &p)
 
template<unsigned n>
SBasisN< n > multiply_add (SBasisN< n > const &a, SBasisN< n > const &b, SBasisN< n > c)
 
template<unsigned n>
SBasisN< n > integral (SBasisN< n > const &c)
 
template<unsigned n>
SBasisN< n > derivative (SBasisN< n > const &a)
 
template<unsigned n>
SBasisN< n > sqrt (SBasisN< n > const &a, int k)
 
template<unsigned n>
SBasisN< n > reciprocal (LinearN< n > const &a, int k)
 
template<unsigned n>
SBasisN< n > divide (SBasisN< n > const &a, SBasisN< n > const &b, int k)
 
template<unsigned n>
unsigned valuation (SBasisN< n > const &a, double tol=0)
 Returns the degree of the first non zero coefficient.
 
template<unsigned n>
SBasisN< n > compose (SBasisN< n > const &a, SBasisN< n > const &b)
 
template<unsigned n>
SBasisN< n > compose (SBasisN< n > const &a, SBasisN< n > const &b, unsigned k)
 
template<unsigned n>
SBasisN< n > inverse (SBasisN< n > a, int k)
 
template<unsigned n>
SBasisN< n > compose_inverse (SBasisN< n > const &f, SBasisN< n > const &g, unsigned order=2, double tol=1e-3)
 
template<unsigned n>
SBasisN< n > portion (const SBasisN< n > &t, double from, double to)
 Returns the sbasis on domain [0,1] that was t on [from, to].
 
template<unsigned n>
SBasisN< n > sin (LinearN< n > bo, int k)
 
template<unsigned n>
SBasisN< n > cos (LinearN< n > bo, int k)
 
template<unsigned n>
std::vector< double > roots (SBasisN< n > const &s)
 
template<unsigned n>
std::vector< std::vector< double > > multi_roots (SBasisN< n > const &f, std::vector< double > const &levels, double htol=1e-7, double vtol=1e-7, double a=0, double b=1)
 
int winding (Path const &path, Point const &p)
 Compute winding number of the path at the specified point.
 
bool path_direction (Path const &p)
 This function should only be applied to simple paths (regions), as otherwise a boolean winding direction is undefined.
 
bool contains (Path const &p, Point const &i, bool evenodd=true)
 
template<typename T >
Crossings curve_sweep (Path const &a, Path const &b)
 
Crossings pair_intersect (Curve const &A, Interval const &Ad, Curve const &B, Interval const &Bd)
 
Crossings mono_intersect (Curve const &A, Interval const &Ad, Curve const &B, Interval const &Bd)
 
std::vector< double > path_mono_splits (Path const &p)
 Finds all the monotonic splits for a path.
 
CrossingSet crossings_among (PathVector const &p)
 
Crossings self_crossings (Path const &a)
 
Crossings crossings (Curve const &a, Curve const &b)
 
Crossings crossings (Path const &a, Path const &b)
 
CrossingSet crossings (PathVector const &a, PathVector const &b)
 
std::ostream & operator<< (std::ostream &os, PathTime const &pos)
 
Piecewise< D2< SBasis > > paths_to_pw (PathVector const &paths)
 
Coord nearest_time (Point const &p, Path const &c)
 
bool are_near (Path const &a, Path const &b, Coord precision=EPSILON)
 
PathIntersection parting_point (Path const &first, Path const &second, Coord precision=EPSILON)
 Find the first point where two paths diverge away from one another.
 
std::ostream & operator<< (std::ostream &out, Path const &path)
 
std::ostream & operator<< (std::ostream &os, PathVectorTime const &pvt)
 
OptRect bounds_fast (PathVector const &pv)
 
OptRect bounds_exact (PathVector const &pv)
 
std::ostream & operator<< (std::ostream &out, PathVector const &pv)
 
template<typename T >
Piecewise< T > operator- (Piecewise< T > const &a, typename T::output_type b)
 
template<typename T >
Piecewise< T > & operator+= (Piecewise< T > &a, typename T::output_type b)
 
template<typename T >
Piecewise< T > & operator-= (Piecewise< T > &a, typename T::output_type b)
 
template<typename T >
Piecewise< T > & operator*= (Piecewise< T > &a, double b)
 
template<typename T >
Piecewise< T > & operator/= (Piecewise< T > &a, double b)
 
template<typename T >
Piecewise< T > & operator+= (Piecewise< T > &a, Piecewise< T > const &b)
 
template<typename T >
Piecewise< T > & operator-= (Piecewise< T > &a, Piecewise< T > const &b)
 
Piecewise< SBasisdivide (Piecewise< SBasis > const &a, Piecewise< SBasis > const &b, unsigned k)
 
Piecewise< SBasisdivide (Piecewise< SBasis > const &a, Piecewise< SBasis > const &b, double tol, unsigned k, double zero=1.e-3)
 
Piecewise< SBasisdivide (SBasis const &a, Piecewise< SBasis > const &b, double tol, unsigned k, double zero=1.e-3)
 
Piecewise< SBasisdivide (Piecewise< SBasis > const &a, SBasis const &b, double tol, unsigned k, double zero=1.e-3)
 
Piecewise< SBasisdivide (SBasis const &a, SBasis const &b, double tol, unsigned k, double zero=1.e-3)
 
std::map< double, unsigned > compose_pullback (std::vector< double > const &cuts, SBasis const &g)
 
int compose_findSegIdx (std::map< double, unsigned >::iterator const &cut, std::map< double, unsigned >::iterator const &next, std::vector< double > const &levels, SBasis const &g)
 
std::vector< double > roots (Piecewise< SBasis > const &f)
 
std::vector< std::vector< double > > multi_roots (Piecewise< SBasis > const &f, std::vector< double > const &values)
 
std::vector< Intervallevel_set (Piecewise< SBasis > const &f, Interval const &level, double tol=1e-5)
 
std::vector< Intervallevel_set (Piecewise< SBasis > const &f, double v, double vtol, double tol=1e-5)
 
bool are_near_rel (Point const &a, Point const &b, double eps=EPSILON)
 Test whether the relative distance between two points is less than some threshold.
 
Point unit_vector (Point const &a)
 
Coord L1 (Point const &p)
 
Coord LInfty (Point const &p)
 
bool is_zero (Point const &p)
 
bool is_unit_vector (Point const &p, Coord eps=EPSILON)
 
double atan2 (Point const &p)
 
double angle_between (Point const &a, Point const &b)
 
Point abs (Point const &b)
 
Point constrain_angle (Point const &A, Point const &B, unsigned n=4, Point const &dir={1, 0})
 
Poly operator* (double a, Poly const &b)
 
Poly integral (Poly const &p)
 
Poly derivative (Poly const &p)
 
Poly divide_out_root (Poly const &p, double x)
 
Poly compose (Poly const &a, Poly const &b)
 
Poly divide (Poly const &a, Poly const &b, Poly &r)
 
Poly gcd (Poly const &a, Poly const &b, const double tol=1e-10)
 
std::vector< std::complex< double > > solve (const Poly &p)
 
std::vector< double > solve_reals (const Poly &p)
 
double polish_root (Poly const &p, double guess, double tol)
 
std::vector< Coordsolve_quadratic (Coord a, Coord b, Coord c)
 Analytically solve quadratic equation.
 
std::vector< Coordsolve_cubic (Coord a, Coord b, Coord c, Coord d)
 Analytically solve cubic equation.
 
std::vector< Coordsolve_quartic (Coord a, Coord b, Coord c, Coord d, Coord e)
 Analytically solve quartic equation.
 
std::ostream & operator<< (std::ostream &out_file, const Poly &in_poly)
 
double distance (Point const &_point, Ray const &_ray)
 
bool are_near (Point const &_point, Ray const &_ray, double eps=EPSILON)
 
bool are_same (Ray const &r1, Ray const &r2, double eps=EPSILON)
 
double angle_between (Ray const &r1, Ray const &r2, bool cw=true)
 
Ray make_angle_bisector_ray (Ray const &r1, Ray const &r2, bool cw=true)
 Returns the angle bisector for the two given rays.
 
Point align_factors (Align align)
 Convert an align specification to coordinate fractions.
 
Coord distanceSq (Point const &p, Rect const &rect)
 
Coord distance (Point const &p, Rect const &rect)
 
Coord distanceSq (Point const &p, OptRect const &rect)
 Minimum square of distance to rectangle, or infinity if empty.
 
Coord distance (Point const &p, OptRect const &rect)
 Minimum distance to rectangle, or infinity if empty.
 
OptRect operator& (Rect const &a, Rect const &b)
 
OptRect intersect (Rect const &a, Rect const &b)
 
OptRect intersect (OptRect const &a, OptRect const &b)
 
Rect unify (Rect const &a, Rect const &b)
 
OptRect unify (OptRect const &a, OptRect const &b)
 
Rect union_list (std::vector< Rect > const &r)
 Union a list of rectangles.
 
Linear extract_u (Linear2d const &a, double u)
 
Linear extract_v (Linear2d const &a, double v)
 
Linear2d operator- (Linear2d const &a)
 
Linear2d operator+ (Linear2d const &a, Linear2d const &b)
 
Linear2d operator- (Linear2d const &a, Linear2d const &b)
 
Linear2doperator+= (Linear2d &a, Linear2d const &b)
 
Linear2doperator-= (Linear2d &a, Linear2d const &b)
 
Linear2doperator*= (Linear2d &a, double b)
 
bool operator== (Linear2d const &a, Linear2d const &b)
 
bool operator!= (Linear2d const &a, Linear2d const &b)
 
Linear2d operator* (double const a, Linear2d const &b)
 
SBasis2d operator- (const SBasis2d &p)
 
SBasis2d operator+ (const SBasis2d &a, const SBasis2d &b)
 
SBasis2d operator- (const SBasis2d &a, const SBasis2d &b)
 
SBasis2doperator+= (SBasis2d &a, const Linear2d &b)
 
SBasis2doperator-= (SBasis2d &a, const Linear2d &b)
 
SBasis2doperator+= (SBasis2d &a, double b)
 
SBasis2doperator-= (SBasis2d &a, double b)
 
SBasis2doperator*= (SBasis2d &a, double b)
 
SBasis2doperator/= (SBasis2d &a, double b)
 
SBasis2d operator* (double k, SBasis2d const &a)
 
SBasis2d operator* (SBasis2d const &a, SBasis2d const &b)
 
SBasis2d shift (SBasis2d const &a, int sh)
 
SBasis2d shift (Linear2d const &a, int sh)
 
SBasis2d truncate (SBasis2d const &a, unsigned terms)
 
SBasis2d multiply (SBasis2d const &a, SBasis2d const &b)
 
SBasis2d integral (SBasis2d const &c)
 
SBasis2d partial_derivative (SBasis2d const &a, int dim)
 
SBasis2d sqrt (SBasis2d const &a, int k)
 
SBasis2d reciprocal (Linear2d const &a, int k)
 
SBasis2d divide (SBasis2d const &a, SBasis2d const &b, int k)
 
SBasis2d compose (SBasis2d const &a, SBasis2d const &b)
 
SBasis2d compose (SBasis2d const &a, SBasis2d const &b, unsigned k)
 
SBasis2d inverse (SBasis2d const &a, int k)
 
SBasis extract_u (SBasis2d const &a, double u)
 
SBasis extract_v (SBasis2d const &a, double v)
 
SBasis compose (Linear2d const &a, D2< SBasis > const &p)
 
SBasis compose (SBasis2d const &fg, D2< SBasis > const &p)
 
D2< SBasiscompose_each (D2< SBasis2d > const &fg, D2< SBasis > const &p)
 
std::ostream & operator<< (std::ostream &out_file, const Linear2d &bo)
 
std::ostream & operator<< (std::ostream &out_file, const SBasis2d &p)
 
D2< SBasissb2dsolve (SBasis2d const &f, Geom::Point const &A, Geom::Point const &B, unsigned degmax)
 Finds a path which traces the 0 contour of f, traversing from A to B as a single d2<sbasis>.
 
D2< SBasissb2d_cubic_solve (SBasis2d const &f, Geom::Point const &A, Geom::Point const &B)
 Finds a path which traces the 0 contour of f, traversing from A to B as a single cubic d2<sbasis>.
 
Piecewise< D2< SBasis > > cutAtRoots (Piecewise< D2< SBasis > > const &M, double tol=1e-4)
 
Piecewise< SBasisatan2 (D2< SBasis > const &vect, double tol=.01, unsigned order=3)
 
Piecewise< SBasisatan2 (Piecewise< D2< SBasis > >const &vect, double tol=.01, unsigned order=3)
 
D2< Piecewise< SBasis > > tan2 (SBasis const &angle, double tol=.01, unsigned order=3)
 
D2< Piecewise< SBasis > > tan2 (Piecewise< SBasis > const &angle, double tol=.01, unsigned order=3)
 
Piecewise< D2< SBasis > > unitVector (D2< SBasis > const &vect, double tol=.01, unsigned order=3)
 
Piecewise< D2< SBasis > > unitVector (Piecewise< D2< SBasis > > const &vect, double tol=.01, unsigned order=3)
 
Piecewise< SBasiscurvature (D2< SBasis > const &M, double tol=.01)
 
Piecewise< SBasiscurvature (Piecewise< D2< SBasis > > const &M, double tol=.01)
 
Piecewise< SBasisarcLengthSb (D2< SBasis > const &M, double tol=.01)
 
Piecewise< SBasisarcLengthSb (Piecewise< D2< SBasis > > const &M, double tol=.01)
 
double length (D2< SBasis > const &M, double tol=.01)
 
double length (Piecewise< D2< SBasis > > const &M, double tol=.01)
 
void length_integrating (D2< SBasis > const &B, double &result, double &abs_error, double tol)
 
Piecewise< D2< SBasis > > arc_length_parametrization (D2< SBasis > const &M, unsigned order=3, double tol=.01)
 
Piecewise< D2< SBasis > > arc_length_parametrization (Piecewise< D2< SBasis > > const &M, unsigned order=3, double tol=.01)
 
unsigned centroid (Piecewise< D2< SBasis > > const &p, Point &centroid, double &area)
 
std::vector< D2< SBasis > > cubics_fitting_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, double d2M0xdM0, double d2M1xdM1, int insist_on_speed_signs=1, double epsilon=1e-5)
 
std::vector< D2< SBasis > > cubics_fitting_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, Point const &d2M0, Point const &d2M1, int insist_on_speed_signs=1, double epsilon=1e-5)
 
std::vector< D2< SBasis > > cubics_with_prescribed_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, double k0, double k1, int insist_on_speed_signs=1, double error=1e-5)
 
std::vector< double > find_tangents (Point P, D2< SBasis > const &A)
 
std::vector< double > find_tangents_by_vector (Point V, D2< SBasis > const &A)
 
std::vector< double > find_normals (Point P, D2< SBasis > const &A)
 
std::vector< double > find_normals_by_vector (Point V, D2< SBasis > const &A)
 
Piecewise< SBasisabs (SBasis const &f)
 Return the absolute value of a function pointwise.
 
Piecewise< SBasisabs (Piecewise< SBasis > const &f)
 Return the absolute value of a function pointwise.
 
Piecewise< SBasismax (SBasis const &f, SBasis const &g)
 Return the greater of the two functions pointwise.
 
Piecewise< SBasismax (Piecewise< SBasis > const &f, SBasis const &g)
 Return the greater of the two functions pointwise.
 
Piecewise< SBasismax (SBasis const &f, Piecewise< SBasis > const &g)
 Return the greater of the two functions pointwise.
 
Piecewise< SBasismax (Piecewise< SBasis > const &f, Piecewise< SBasis > const &g)
 Return the greater of the two functions pointwise.
 
Piecewise< SBasismin (SBasis const &f, SBasis const &g)
 Return the more negative of the two functions pointwise.
 
Piecewise< SBasismin (Piecewise< SBasis > const &f, SBasis const &g)
 Return the more negative of the two functions pointwise.
 
Piecewise< SBasismin (SBasis const &f, Piecewise< SBasis > const &g)
 Return the more negative of the two functions pointwise.
 
Piecewise< SBasismin (Piecewise< SBasis > const &f, Piecewise< SBasis > const &g)
 Return the more negative of the two functions pointwise.
 
Piecewise< SBasissignSb (SBasis const &f)
 Return the sign of the two functions pointwise.
 
Piecewise< SBasissignSb (Piecewise< SBasis > const &f)
 Return the sign of the two functions pointwise.
 
Piecewise< SBasissqrt (SBasis const &f, double tol, int order)
 Compute the sqrt of a function.
 
Piecewise< SBasissqrt (Piecewise< SBasis > const &f, double tol, int order)
 Compute the sqrt of a function.
 
Piecewise< SBasiscos (SBasis const &f, double tol, int order)
 Compute the cosine of a function.
 
Piecewise< SBasiscos (Piecewise< SBasis > const &f, double tol, int order)
 Compute the cosine of a function.
 
Piecewise< SBasissin (SBasis const &f, double tol, int order)
 Compute the sine of a function.
 
Piecewise< SBasissin (Piecewise< SBasis > const &f, double tol, int order)
 Compute the sine of a function.
 
Piecewise< SBasislog (SBasis const &f, double tol=1e-3, int order=3)
 
Piecewise< SBasislog (Piecewise< SBasis >const &f, double tol=1e-3, int order=3)
 
Piecewise< SBasisreciprocalOnDomain (Interval range, double tol=1e-3)
 
Piecewise< SBasisreciprocal (SBasis const &f, double tol=1e-3, int order=3)
 
Piecewise< SBasisreciprocal (Piecewise< SBasis >const &f, double tol=1e-3, int order=3)
 
Piecewise< SBasisinterpolate (std::vector< double > times, std::vector< double > values, unsigned smoothness)
 Returns a Piecewise SBasis with prescribed values at prescribed times.
 
SBasis poly_to_sbasis (Poly const &p)
 Changes the basis of p to be sbasis.
 
Poly sbasis_to_poly (SBasis const &sb)
 Changes the basis of p to be monomial.
 
void sbasis_to_bezier (Bezier &bz, SBasis const &sb, size_t sz)
 Changes the basis of p to be bernstein.
 
void sbasis_to_bezier (D2< Bezier > &bz, D2< SBasis > const &sb, size_t sz=0)
 
void sbasis_to_bezier (std::vector< Point > &bz, D2< SBasis > const &sb, size_t sz)
 Changes the basis of p to be Bernstein.
 
void sbasis_to_cubic_bezier (std::vector< Point > &bz, D2< SBasis > const &sb)
 Changes the basis of p to be Bernstein.
 
void bezier_to_sbasis (D2< SBasis > &sb, std::vector< Point > const &bz)
 Changes the basis of d2 p to be sbasis.
 
void build_from_sbasis (Geom::PathBuilder &pb, D2< SBasis > const &B, double tol, bool only_cubicbeziers)
 Make a path from a d2 sbasis.
 
Bezier sbasis_to_bezier (SBasis const &B, unsigned q=0)
 
SBasis bezier_to_sbasis (Bezier const &B)
 
std::vector< Geom::Pointsbasis_to_bezier (D2< SBasis > const &B, unsigned q=0)
 
PathVector path_from_piecewise (Geom::Piecewise< Geom::D2< Geom::SBasis > > const &B, double tol, bool only_cubicbeziers)
 Make a path from a d2 sbasis.
 
Path path_from_sbasis (D2< SBasis > const &B, double tol, bool only_cubicbeziers)
 Make a path from a d2 sbasis.
 
Path cubicbezierpath_from_sbasis (D2< SBasis > const &B, double tol)
 
SBasis operator- (const SBasis &p)
 
SBasis operator* (SBasis const &a, double k)
 Compute the pointwise product of a and b (Exact)
 
SBasis operator* (double k, SBasis const &a)
 
SBasis operator/ (SBasis const &a, double k)
 
SBasisoperator*= (SBasis &a, double b)
 Compute the pointwise product of a and b and store the value in a (Exact)
 
SBasisoperator/= (SBasis &a, double b)
 
SBasis operator+ (const SBasis &a, const SBasis &b)
 Compute the pointwise sum of a and b (Exact)
 
SBasis operator- (const SBasis &a, const SBasis &b)
 Compute the pointwise difference of a and b (Exact)
 
SBasisoperator+= (SBasis &a, const SBasis &b)
 Compute the pointwise sum of a and b and store in a (Exact)
 
SBasisoperator-= (SBasis &a, const SBasis &b)
 Compute the pointwise difference of a and b and store in a (Exact)
 
SBasis operator+ (const SBasis &a, double b)
 
SBasis operator- (const SBasis &a, double b)
 
SBasisoperator+= (SBasis &a, double b)
 
SBasisoperator-= (SBasis &a, double b)
 
SBasis shift (SBasis const &a, int sh)
 multiply a by x^sh in place (Exact)
 
SBasis shift (Linear const &a, int sh)
 multiply a by x^sh (Exact)
 
SBasis truncate (SBasis const &a, unsigned terms)
 
SBasis multiply (SBasis const &a, SBasis const &b)
 Compute the pointwise product of a and b (Exact)
 
SBasis multiply_add (SBasis const &a, SBasis const &b, SBasis c)
 Compute the pointwise product of a and b adding c (Exact)
 
SBasis integral (SBasis const &c)
 Compute the integral of a (Exact)
 
SBasis derivative (SBasis const &a)
 Compute the derivative of a (Exact)
 
SBasis sqrt (SBasis const &a, int k)
 Compute the sqrt of a.
 
SBasis reciprocal (Linear const &a, int k)
 Compute the recpirocal of a.
 
SBasis divide (SBasis const &a, SBasis const &b, int k)
 Compute a / b to k terms.
 
SBasis operator* (SBasis const &a, SBasis const &b)
 
SBasisoperator*= (SBasis &a, SBasis const &b)
 
SBasis compose (SBasis const &a, SBasis const &b)
 Compute a composed with b.
 
SBasis compose (SBasis const &a, SBasis const &b, unsigned k)
 Compute a composed with b to k terms.
 
SBasis inverse (SBasis a, int k)
 find the function a^-1 such that a^-1 composed with a to k terms is the identity function
 
SBasis compose_inverse (SBasis const &f, SBasis const &g, unsigned order, double zero)
 compute fog^-1.
 
SBasis portion (const SBasis &t, Interval const &ivl)
 
std::ostream & operator<< (std::ostream &out_file, const Linear &bo)
 
std::ostream & operator<< (std::ostream &out_file, const SBasis &p)
 
SBasis sin (Linear b, int k)
 Compute the sine of a to k terms.
 
SBasis cos (Linear bo, int k)
 Compute the cosine of a.
 
std::vector< double > roots (SBasis const &s, Interval const inside)
 
std::vector< Intervallevel_set (SBasis const &f, double level, double vtol=1e-5, double a=0., double b=1., double tol=1e-5)
 Solve f(t) = v +/- tolerance.
 
std::vector< Intervallevel_set (SBasis const &f, Interval const &level, double a=0., double b=1., double tol=1e-5)
 Solve f(t)\in I=[u,v], which defines a collection of intervals (J_k).
 
std::vector< std::vector< Interval > > level_sets (SBasis const &f, std::vector< double > const &levels, double a=0., double b=1., double vtol=1e-5, double tol=1e-5)
 'Solve' f(t) = v +/- tolerance for several values of v at once.
 
std::vector< std::vector< Interval > > level_sets (SBasis const &f, std::vector< Interval > const &levels, double a=0., double b=1., double tol=1e-5)
 'Solve' f(t)\in I=[u,v] for several intervals I at once.
 
unsigned crossing_count (Geom::Point const *V, unsigned degree)
 
void find_parametric_bezier_roots (Geom::Point const *w, unsigned degree, std::vector< double > &solutions, unsigned depth)
 
unsigned crossing_count (double const *V, unsigned degree, double left_t, double right_t)
 
void find_bernstein_roots (double const *w, unsigned degree, std::vector< double > &solutions, unsigned depth, double left_t=0, double right_t=1, bool use_secant=true)
 
void parse_svg_path (char const *str, PathSink &sink)
 Feed SVG path data to the specified sink.
 
void parse_svg_path (std::string const &str, PathSink &sink)
 Feed SVG path data to the specified sink.
 
void parse_svg_path_file (FILE *fi, PathSink &sink)
 Feed SVG path data from a C stream to the specified sink.
 
PathVector parse_svg_path (char const *str)
 Create path vector from SVG path data stored in a C string.
 
PathVector read_svgd_f (FILE *fi)
 Create path vector from a C stream with SVG path data.
 
PathVector read_svgd (char const *filename)
 Create path vector from SVG path data stored in a file.
 
std::string write_svg_path (PathVector const &pv, int prec=-1, bool optimize=false, bool shorthands=true)
 
std::vector< std::vector< unsigned > > sweep_bounds (std::vector< Rect > rs, Dim2 d)
 Make a list of pairs of self intersections in a list of Rects.
 
std::vector< std::vector< unsigned > > sweep_bounds (std::vector< Rect > a, std::vector< Rect > b, Dim2 d)
 Make a list of pairs of red-blue intersections between two lists of Rects.
 
template<typename T >
pow (T const &t, int n)
 Integer exponentiation for transforms.
 
bool are_near (Translate const &a, Translate const &b, Coord eps=EPSILON)
 
bool are_near (Scale const &a, Scale const &b, Coord eps=EPSILON)
 
bool are_near (Rotate const &a, Rotate const &b, Coord eps=EPSILON)
 
bool are_near (HShear const &a, HShear const &b, Coord eps=EPSILON)
 
bool are_near (VShear const &a, VShear const &b, Coord eps=EPSILON)
 
bool are_near (Zoom const &a, Zoom const &b, Coord eps=EPSILON)
 
Affine reflection (Point const &vector, Point const &origin)
 Reflects objects about line.
 
void binomial_coefficients (std::vector< size_t > &bc, std::size_t n)
 
template<typename Iter , typename Container >
Iter cyclic_next (Iter i, Container &c)
 Get the next iterator in the container with wrap-around.
 
template<typename Iter , typename Container >
Iter cyclic_prior (Iter i, Container &c)
 Get the previous iterator in the container with wrap-around.
 
void split (vector< Point > const &p, double t, vector< Point > &left, vector< Point > &right)
 
static int intersect_polish_f (const gsl_vector *x, void *params, gsl_vector *f)
 
static double EpsilonBy (double value, int eps)
 
static void intersect_polish_root (D2< SBasis > const &A, double &s, D2< SBasis > const &B, double &t)
 
template<unsigned degree>
static std::vector< CurveIntersectionbezier_line_intersections (BezierCurveN< degree > const &curve, Line const &line)
 Find intersections of a low-degree Bézier curve with a line segment.
 
static void bezier_expand_to_image (Rect &range, Point const &x0, Point const &x1, Point const &x2)
 
static void bezier_expand_to_image (Rect &range, Point const &x0, Point const &x1, Point const &x2, Point const &x3)
 
static Coord bezier_length_internal (std::vector< Point > &v1, Coord tolerance, int level)
 
static Coord bezier_length_internal (Point a0, Point a1, Point a2, Coord tolerance, int level)
 
static Coord bezier_length_internal (Point a0, Point a1, Point a2, Point a3, Coord tolerance, int level)
 
static void generate_bezier (Point bezier[], Point const data[], double const u[], unsigned const len, Point const &tHat1, Point const &tHat2, double const tolerance_sq)
 Fill in bezier[] based on the given data and tangent requirements, using a least-squares fit.
 
static void estimate_lengths (Point bezier[], Point const data[], double const u[], unsigned len, Point const &tHat1, Point const &tHat2)
 
static void estimate_bi (Point b[4], unsigned ei, Point const data[], double const u[], unsigned len)
 
static void reparameterize (Point const d[], unsigned const len, double u[], Point const bezCurve[])
 Given set of points and their parameterization, try to find a better assignment of parameter values for the points.
 
static double NewtonRaphsonRootFind (Point const Q[], Point const &P, double const u)
 Use Newton-Raphson iteration to find better root.
 
static Point darray_center_tangent (Point const d[], unsigned const center, unsigned const len)
 Estimates the (backward) tangent at d[center], by averaging the two segments connected to d[center] (and then normalizing the result).
 
static Point darray_right_tangent (Point const d[], unsigned const len)
 Estimates the (backward) tangent at d[last - 0.5].
 
static unsigned copy_without_nans_or_adjacent_duplicates (Point const src[], unsigned src_len, Point dest[])
 Copy points from src to dest, filter out points containing NaN and adjacent points with equal x and y.
 
static void chord_length_parameterize (Point const d[], double u[], unsigned const len)
 Assign parameter values to digitized points using relative distances between points.
 
static double compute_max_error_ratio (Point const d[], double const u[], unsigned const len, Point const bezCurve[], double const tolerance, unsigned *const splitPoint)
 Find the maximum squared distance of digitized points to fitted curve, and (if this maximum error is non-zero) set *splitPoint to the corresponding index.
 
static double compute_hook (Point const &a, Point const &b, double const u, Point const bezCurve[], double const tolerance)
 Whereas compute_max_error_ratio() checks for itself that each data point is near some point on the curve, this function checks that each point on the curve is near some data point (or near some point on the polyline defined by the data points, or something like that: we allow for a "reasonable curviness" from such a polyline).
 
int bezier_fit_cubic (Point *bezier, Point const *data, int len, double error)
 Fit a single-segment Bezier curve to a set of digitized points.
 
static double lensq (Point const p)
 
void concept_checks ()
 
double signed_triangle_area (Point const &p1, Point const &p2, Point const &p3)
 
LineSegment intersection (Line l, Rect r)
 
static double det (Point a, Point b)
 
template<typename T >
static T det (T a, T b, T c, T d)
 
template<typename T >
static T det (T M[2][2])
 
template<typename T >
static T det3 (T M[3][3])
 
static double boxprod (Point a, Point b, Point c)
 
template<typename T >
std::string stringify (T x)
 
std::vector< Pointdecompose_degenerate (xAx const &C1, xAx const &C2, xAx const &xC0)
 
double xAx_descr (xAx const &C)
 
std::optional< Pointsolve (double A[2][2], double b[2])
 
bool at_infinity (Point const &p)
 
static bool is_clockwise_turn (Point const &a, Point const &b, Point const &c)
 
template<typename Iter , typename Lex >
bool below_x_monotonic_polyline (Point const &p, Iter first, Iter last, Lex lex)
 
double SignedTriangleArea (Point p0, Point p1, Point p2)
 
int mod (int i, int l)
 
int sgn (double x)
 
bool same_side (Point L[2], Point xs[4])
 
std::vector< pair< int, int > > bridges (ConvexHull a, ConvexHull b)
 find bridging pairs between two convex hulls.
 
unsigned find_bottom_right (ConvexHull const &a)
 
ConvexHull sweepline_intersection (ConvexHull const &a, ConvexHull const &b)
 
ConvexHull intersection (ConvexHull, ConvexHull)
 
template<typename T >
idx_to_pair (pair< T, T > p, int idx)
 
ConvexHull merge (ConvexHull a, ConvexHull b)
 
ConvexHull graham_merge (ConvexHull a, ConvexHull b)
 
ConvexHull andrew_merge (ConvexHull a, ConvexHull b)
 
std::string format_coord_shortest (Coord x)
 
std::string format_coord_nice (Coord x)
 
Coord parse_coord (std::string const &s)
 
double wrap_dist (double from, double to, double size, bool rev)
 
static void set_first_point (Piecewise< D2< SBasis > > &f, Point const &a)
 
static void set_last_point (Piecewise< D2< SBasis > > &f, Point const &a)
 
static std::vector< Intervalintersect (std::vector< Interval > const &a, std::vector< Interval > const &b)
 
static std::array< Coord, 2 > axis_time_to_angles (Coord t, bool vertical)
 Convert curve time on the major axis to the corresponding angle parameters on a degenerate ellipse collapsed onto that axis.
 
static std::vector< ShapeIntersectiondouble_axis_intersections (std::vector< ShapeIntersection > &&axis_intersections, bool vertical)
 For each intersection of some shape with the major axis of an ellipse, produce one or two intersections of a degenerate ellipse (collapsed onto that axis) with the same shape.
 
bool are_near (Ellipse const &a, Ellipse const &b, Coord precision)
 
std::ostream & operator<< (std::ostream &out, Ellipse const &e)
 
bool arc_from_sbasis (EllipticalArc &ea, D2< SBasis > const &in, double tolerance, unsigned num_samples)
 
std::ostream & operator<< (std::ostream &out, EllipticalArc const &ea)
 
IntersectorKind line_intersection (Geom::Point const &n0, double const d0, Geom::Point const &n1, double const d1, Geom::Point &result)
 Finds the intersection of the two (infinite) lines defined by the points p such that dot(n0, p) == d0 and dot(n1, p) == d1.
 
int intersector_ccw (const Geom::Point &p0, const Geom::Point &p1, const Geom::Point &p2)
 
bool line_segment_intersectp (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11)
 Determine whether the line segment from p00 to p01 intersects the infinite line passing through p10 and p11.
 
bool segment_intersectp (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11)
 Determine whether two line segments intersect.
 
IntersectorKind line_segment_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result)
 Determine whether & where a line segments intersects an (infinite) line.
 
IntersectorKind segment_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result)
 Determine whether & where two line segments intersect.
 
IntersectorKind line_twopoint_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result)
 Determine whether & where two line segments intersect.
 
static bool is_less (Point const &A, Point const &B)
 
static void eliminate_duplicates_p (std::vector< Point > &pts)
 
std::vector< Geom::Pointrect_line_intersect (Geom::Point const &c0, Geom::Point const &c1, Geom::Point const &p0, Geom::Point const &p1)
 Determine whether & where an (infinite) line intersects a rectangle.
 
std::optional< LineSegmentrect_line_intersect (Geom::Rect &r, Geom::Line l)
 
Line make_angle_bisector_line (Line const &l1, Line const &l2)
 
SBasis cheb (unsigned n)
 
SBasis cheb_series (unsigned n, double *cheb_coeff)
 
SBasis clenshaw_series (unsigned m, double *cheb_coeff)
 
double f_interp (double x, void *p)
 
static void computeLinfinityNeighborhood (D2< SBasis > const &f, double tol, D2< Piecewise< SBasis > > &topside, D2< Piecewise< SBasis > > &botside)
 
static void computeLinfinityNeighborhood (Piecewise< SBasis > const &f, double tol, Piecewise< SBasis > &top, Piecewise< SBasis > &bot)
 
static void prolongateByConstants (Piecewise< SBasis > &f, double paddle_width)
 
static bool compareIntersectionsTimesX (SmashIntersection const &inter1, SmashIntersection const &inter2)
 
static void cleanup_and_fuse (std::vector< SmashIntersection > &inters)
 
static std::vector< Intervalintersect (std::vector< Interval > const &a, std::vector< Interval > const &b)
 
static float sign (double number)
 Returns +1 for positive numbers, -1 for negative numbers, and 0 otherwise.
 
static float find_direction_of_travel (Path const &path, PathTime const &time, Dim2 d)
 Determine whether the d-coordinate increases or decreases at the given path time.
 
template<typename T >
void append (T &a, T const &b)
 A little sugar for appending a list to another.
 
bool linear_intersect (Point const &A0, Point const &A1, Point const &B0, Point const &B1, double &tA, double &tB, double &det)
 Finds the intersection between the lines defined by A0 & A1, and B0 & B1.
 
static double EpsilonOf (double value)
 
static int intersect_polish_f (const gsl_vector *x, void *params, gsl_vector *f)
 
static void intersect_polish_root (Curve const &A, double &s, Curve const &B, double &t)
 
void pair_intersect (Curve const &A, double Al, double Ah, Curve const &B, double Bl, double Bh, Crossings &ret, unsigned depth=0)
 This uses the local bounds functions of curves to generically intersect two.
 
void mono_intersect (Curve const &A, double Al, double Ah, Curve const &B, double Bl, double Bh, Crossings &ret, double tol=0.1, unsigned depth=0)
 
void mono_pair (Path const &A, double Al, double Ah, Path const &B, double Bl, double Bh, Crossings &ret, double, unsigned depth=0)
 Takes two paths and time ranges on them, with the invariant that the paths are monotonic on the range.
 
std::vector< double > curve_mono_splits (Curve const &d)
 This returns the times when the x or y derivative is 0 in the curve.
 
std::vector< double > offset_doubles (std::vector< double > const &x, double offs)
 Convenience function to add a value to each entry in a vector of doubles.
 
std::vector< std::vector< double > > paths_mono_splits (PathVector const &ps)
 Applies path_mono_splits to multiple paths, and returns the results such that time-set i corresponds to Path i.
 
std::vector< std::vector< Rect > > split_bounds (PathVector const &p, std::vector< std::vector< double > > splits)
 Processes the bounds for a list of paths and a list of splits on them, yielding a list of rects for each.
 
Crossings curve_self_crossings (Curve const &a)
 
void flip_crossings (Crossings &crs)
 
template<typename iter >
iter inc (iter const &x, unsigned n)
 
Piecewise< SBasispw_compose_inverse (SBasis const &f, SBasis const &g, unsigned order, double zero)
 
std::ostream & operator<< (std::ostream &out, Geom::Point const &p)
 
static void find_intersections_bezier_recursive (std::vector< std::pair< double, double > > &xs, OldBezier a, OldBezier b)
 
void find_intersections_bezier_recursive (std::vector< std::pair< double, double > > &xs, vector< Geom::Point > const &A, vector< Geom::Point > const &B, double)
 
bool intersect_BB (OldBezier a, OldBezier b)
 
void recursively_intersect (OldBezier a, double t0, double t1, int deptha, OldBezier b, double u0, double u1, int depthb, std::vector< std::pair< double, double > > &parameters)
 
double log4 (double x)
 
double Lmax (Point p)
 
unsigned wangs_theorem (OldBezier)
 
static Piecewise< SBasissqrt_internal (SBasis const &f, double tol, int order)
 
void truncateResult (Piecewise< SBasis > &f, int order)
 
SBasis portion (const SBasis &t, double from, double to)
 
void find_bernstein_roots (std::vector< double > &solutions, Geom::Bezier const &bz, double left_t, double right_t)
 
static unsigned control_poly_flat_enough (Geom::Point const *V, unsigned degree)
 
static double compute_x_intercept (Geom::Point const *V, unsigned degree)
 
static bool is_digit (char c)
 
std::vector< std::vector< unsigned > > fake_cull (unsigned a, unsigned b)
 
void check_transforms ()
 
template<typename Curve01T , typename CurveT >
Piecewise< SBasisdistance (Curve01T const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3)
 
template<typename CurveT >
Piecewise< SBasisdistance (Piecewise< D2< SBasis > > const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3)
 
template<typename CurveT >
Piecewise< SBasisdistance (Path const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3)
 
template<typename Curve01T , typename CurveT >
unsigned int dist_test (Piecewise< SBasis > const &pwc, Curve01T const &A, CurveT const &B, double step)
 
bool make_elliptical_arc (EllipticalArc &ea, Point const &centre, Point const &initial, Point const &final, Point const &inner)
 
void subdiv_sbasis (SBasis const &s, std::vector< double > &roots, double left, double right)
 
 TEST (AffineTest, Equality)
 
 TEST (AffineTest, Classification)
 
 TEST (AffineTest, Inversion)
 
 TEST (AffineTest, CoordinateAccess)
 
 TEST (AffineTest, Nearness)
 
 TEST (AffineTest, Multiplication)
 
 TEST (CoordTest, StringRoundtripShortest)
 
 TEST (CoordTest, StringRoundtripNice)
 
template<typename IntervalType , typename OptIntervalType >
constexpr bool equality_test ()
 
 TEST (IntervalTest, EqualityTest)
 
template<typename IntervalType >
constexpr bool structured_binding_test ()
 
 TEST (IntervalTest, StructuredBindingTest)
 
 TEST (IntervalTest, Hash)
 
auto aligned_bbox (std::vector< Point > const &pts, Affine const &affine=identity())
 
double approx_min (std::vector< Point > const &pts)
 
auto randpts ()
 
 TEST (MinBBoxTest, Empty)
 
 TEST (MinBBoxTest, SinglePoint)
 
 TEST (MinBBoxTest, Randomised)
 
NL::Vector V3 (double a, double b, double c)
 
 TEST_F (VectorTest, VectorStringRepresentation)
 
 TEST_F (VectorTest, VectorConstructFromAnother)
 
 TEST_F (VectorTest, OperatorEqualIsDefined)
 
 TEST_F (VectorTest, OperatorNotEqualIsntDefined)
 
 TEST_F (VectorTest, VectorAssignment)
 
 TEST_F (VectorTest, AssignedVectorMustBeSameSize)
 
 TEST_F (VectorTest, VectorScalesInplace)
 
 TEST_F (VectorTest, VectorTranslatesInplace)
 
 TEST_F (VectorTest, ScaleAndTranslateUsesFluentSyntax)
 
 TEST_F (VectorTest, AddAssignment)
 
 TEST_F (VectorTest, SubtractAssignment)
 
 TEST_F (VectorTest, SwappingElements)
 
 TEST_F (VectorTest, Reverse)
 
 TEST (Vector, IsPositive)
 
 TEST_F (VectorTest, IsZero)
 
 TEST_F (VectorTest, IsNonNegative)
 
 TEST (Vector, Max)
 
 TEST (Vector, MaxIndex)
 
 TEST (Vector, Min)
 
 TEST (Vector, MinIndex)
 
 TEST_F (VectorTest, SetAll)
 
 TEST_F (VectorTest, SetBasis)
 
 TEST (Vector, SwappingVectors)
 
 TEST_F (VectorViewTest, ViewCountOnly)
 
 TEST_F (VectorViewTest, SkipSomeInitialElements)
 
 TEST_F (VectorViewTest, SparseViewConstruction)
 
 TEST_F (VectorViewTest, ConstructFromAnotherView)
 
 TEST_F (VectorViewTest, PartialSourceModification)
 
 TEST_F (VectorViewTest, ViewScalesInplace)
 
 TEST_F (VectorViewTest, ViewScaleAndTranslateUsesFluentSyntax)
 
 TEST_F (VectorViewTest, AssignmentFromVectorAvailableForViews)
 
 TEST_F (VectorViewTest, AssignmentFromVectorMustBeSameSize)
 
 TEST_F (VectorViewTest, AssignmentFromViewAvailableForViews)
 
 TEST_F (VectorViewTest, AssignmentFromViewMustBeSameSize)
 
 TEST_F (VectorViewTest, AddAssignAvailableForViews)
 
 TEST_F (VectorViewTest, SubtractAssignAvailableForViews)
 
 TEST_F (VectorViewTest, SwappingFromSameSourceVectorDoesNotModifySource)
 
 TEST_F (VectorViewTest, SwappingFromSameSourceVectorModifiesViews)
 
 TEST_F (VectorViewTest, SwappingDifferentLengthViewFails)
 
 TEST (PointTest, Normalize)
 
 TEST (PointTest, ScalarOps)
 
 TEST (PointTest, Rounding)
 
 TEST (PointTest, Near)
 
 TEST (PointTest, Multiplicative)
 
 TEST (PointTest, PointCtors)
 
 TEST (PointTest, IntPointCtors)
 
 TEST (PointTest, Hash)
 
 TEST (RectTest, Upconversion)
 
 TEST (RectTest, Rounding)
 
 TEST (RectTest, ExpansionInPlace)
 
 TEST (RectTest, Expanded)
 
 TEST (RectTest, ShrinkingInPlace)
 
 TEST (RectTest, Shrunk)
 
 TYPED_TEST_CASE (GenericRectTest, CoordTypes)
 
 TYPED_TEST (GenericRectTest, EqualityTest)
 
 TYPED_TEST (GenericRectTest, Intersects)
 
 TYPED_TEST (GenericRectTest, JonCruzRect)
 JonCruz failure: (10, 20)-(55,30) and (45,20)-(100,30) should intersect.
 
 TYPED_TEST (GenericRectTest, Intersection)
 
 TYPED_TEST (GenericRectTest, Contains)
 
 TYPED_TEST (GenericRectTest, Union)
 
 TYPED_TEST (GenericRectTest, Area)
 
 TYPED_TEST (GenericRectTest, Emptiness)
 
 TYPED_TEST (GenericRectTest, Dimensions)
 
 TYPED_TEST (GenericRectTest, Modification)
 
 TYPED_TEST (GenericRectTest, OptRectDereference)
 
 TYPED_TEST (GenericRectTest, Offset)
 
 TYPED_TEST (GenericRectTest, NearestEdgePoint)
 
NodeType get_nodetype (Curve const &c_incoming, Curve const &c_outgoing)
 
static Point intersection_point (Point origin_a, Point vector_a, Point origin_b, Point vector_b)
 
static Circle touching_circle (D2< SBasis > const &curve, double t, double tol=0.01)
 Find circle that touches inside of the curve, with radius matching the curvature, at time value t.
 
static double area (Geom::Point a, Geom::Point b, Geom::Point c)
 
static Circle touching_circle (CubicBezier const &curve, bool start)
 
static std::optional< Pointintersection_point (Point const &origin_a, Point const &vector_a, Point const &origin_b, Point const &vector_b)
 Find the point where two straight lines cross.
 
static Geom::CubicBezier sbasis_to_cubicbezier (Geom::D2< Geom::SBasis > const &sbasis_in)
 
static Ellipse find_ellipse (Point P, Point Q, Point O)
 document this! very quick: this finds the ellipse with minimum eccentricity passing through point P and Q, with tangent PO at P and QO at Q http://mathforum.org/kb/message.jspa?messageID=7471596&tstart=0
 
static Circle touching_circle (D2< SBasis > const &curve, double t, double tol=0.01)
 Find circle that touches inside of the curve, with radius matching the curvature, at time value t.
 

Variables

constexpr Coord EPSILON = 1e-6
 Default "acceptably small" value.
 
static Point const unconstrained_tangent (0, 0)
 
const unsigned MAXDEPTH = 64
 
const double BEPSILON = ldexp(1.0,-MAXDEPTH-1)
 
unsigned total_steps
 
unsigned total_subs
 
static const char _svg_path_actions []
 
static const short _svg_path_key_offsets []
 
static const char _svg_path_trans_keys []
 
static const char _svg_path_single_lengths []
 
static const char _svg_path_range_lengths []
 
static const short _svg_path_index_offsets []
 
static const short _svg_path_indicies []
 
static const short _svg_path_trans_targs []
 
static const char _svg_path_trans_actions []
 
static const char _svg_path_eof_actions []
 
static const int svg_path_start = 234
 
static const int svg_path_first_final = 234
 
static const int svg_path_en_main = 234
 
xAx degen
 

Detailed Description

Various utility functions.

@TODO Move this to 2geom?

Copyright 2008 Marco Cecchetti <mrcekets at gmail.com> Copyright 2007 Johan Engelen goeje.nosp@m.ndaa.nosp@m.gh@zo.nosp@m.nnet.nosp@m..nl Copyright 2006 Michael G. Sloan mgslo.nosp@m.an@g.nosp@m.mail..nosp@m.com

This library is free software; you can redistribute it and/or modify it either under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation (the "LGPL") or, at your option, under the terms of the Mozilla Public License Version 1.1 (the "MPL"). If you do not alter this notice, a recipient may use your version of this file under either the MPL or the LGPL.

You should have received a copy of the LGPL along with this library in the file COPYING-LGPL-2.1; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You should have received a copy of the MPL along with this library in the file COPYING-MPL-1.1

The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the LGPL or the MPL for the specific language governing rights and limitations.

Typedef Documentation

◆ CoordTypes

typedef ::testing::Types<Coord, IntCoord> Geom::CoordTypes

Definition at line 40 of file rect-test.cpp.

◆ Crossings

typedef std::vector<Crossing> Geom::Crossings

Definition at line 126 of file crossing.h.

◆ CrossingSet

typedef std::vector<Crossings> Geom::CrossingSet

Definition at line 128 of file crossing.h.

◆ CurveIntersection

Definition at line 54 of file curve.h.

◆ DefaultCrosser

Definition at line 83 of file path-intersection.h.

◆ ErrorCode

using Geom::ErrorCode = typedef int

Definition at line 43 of file utils.h.

◆ IntRect

Definition at line 57 of file forward.h.

◆ Linear

typedef Geom::LinearOf<double> Geom::Linear

Definition at line 71 of file linear-of.h.

◆ OptCrossing

typedef std::optional<Crossing> Geom::OptCrossing

Definition at line 64 of file crossing.h.

◆ OptIntRect

Definition at line 58 of file forward.h.

◆ PathIntersection

Definition at line 278 of file path.h.

◆ PathVectorIntersection

◆ PVIntersection

Alias to save typing.

Definition at line 90 of file pathvector.h.

◆ PyInterval

◆ PyOptInterval

◆ PyOptRect

◆ PyPoint

Definition at line 207 of file wrapped-pyobject.h.

◆ PyRect

Definition at line 204 of file wrapped-pyobject.h.

◆ SBasis

typedef Geom::SBasisOf<double> Geom::SBasis

Definition at line 54 of file sbasis-of.h.

◆ ShapeIntersection

Definition at line 132 of file intersection.h.

◆ SubpathInserter

typedef std::back_insert_iterator<PathVector> Geom::SubpathInserter

Definition at line 222 of file path-sink.h.

Enumeration Type Documentation

◆ Align

Values for the <align> parameter of preserveAspectRatio.

See: http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute

Enumerator
ALIGN_NONE 
ALIGN_XMIN_YMIN 
ALIGN_XMID_YMIN 
ALIGN_XMAX_YMIN 
ALIGN_XMIN_YMID 
ALIGN_XMID_YMID 
ALIGN_XMAX_YMID 
ALIGN_XMIN_YMAX 
ALIGN_XMID_YMAX 
ALIGN_XMAX_YMAX 

Definition at line 51 of file rect.h.

◆ enum_add_to_group

Enumerator
ADD_TO_GROUP_A 
ADD_TO_GROUP_B 

Definition at line 54 of file rtree.h.

◆ enum_split_strategy

Enumerator
QUADRATIC_SPIT 
LINEAR_COST 
TOTAL_STRATEGIES 

Definition at line 60 of file rtree.h.

◆ Errors

Enumerator
GEOM_ERR_INTERSECGRAPH 

Definition at line 44 of file utils.h.

◆ Expansion

Values for the <meetOrSlice> parameter of preserveAspectRatio.

See: http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute

Enumerator
EXPANSION_MEET 
EXPANSION_SLICE 

Definition at line 66 of file rect.h.

◆ IntersectorKind

Enumerator
intersects 
parallel 
coincident 
no_intersection 

Definition at line 15 of file geom.cpp.

◆ NodeType

What kind of node is this? This is the value for the node->type field.

NodeType indicates the degree of continuity required for the node. I think that the corresponding integer indicates which derivate is connected. (Thus 2 means that the node is continuous to the second derivative, i.e. has matching endpoints and tangents)

Enumerator
NODE_NONE 

Discontinuous node, usually either start or endpoint of a path.

NODE_CUSP 

This node continuously joins two segments, but the unit tangent is discontinuous.

NODE_SMOOTH 

This node continuously joins two segments, with continuous unit tangent.

NODE_SYMM 

This node is symmetric.

I.e. continuously joins two segments with continuous derivative

Definition at line 29 of file geom-nodetype.h.

Function Documentation

◆ abs() [1/3]

Piecewise< SBasis > Geom::abs ( Piecewise< SBasis > const &  f)

Return the absolute value of a function pointwise.

Parameters
ffunction

Definition at line 57 of file sbasis-math.cpp.

References roots(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().

◆ abs() [2/3]

◆ abs() [3/3]

Piecewise< SBasis > Geom::abs ( SBasis const &  f)

Return the absolute value of a function pointwise.

Parameters
ffunction

Definition at line 51 of file sbasis-math.cpp.

References abs().

◆ align_factors()

Point Geom::align_factors ( Align  align)

Convert an align specification to coordinate fractions.

Definition at line 37 of file rect.cpp.

References ALIGN_XMAX_YMAX, ALIGN_XMAX_YMID, ALIGN_XMAX_YMIN, ALIGN_XMID_YMAX, ALIGN_XMID_YMID, ALIGN_XMID_YMIN, ALIGN_XMIN_YMAX, ALIGN_XMIN_YMID, ALIGN_XMIN_YMIN, X, and Y.

Referenced by Geom::Rect::transformTo().

◆ aligned_bbox()

auto Geom::aligned_bbox ( std::vector< Point > const &  pts,
Affine const &  affine = identity() 
)

Definition at line 10 of file min-bbox-test.cpp.

References Geom::GenericOptRect< C >::expandTo().

Referenced by approx_min(), and TEST().

◆ all_nearest_times() [1/4]

std::vector< double > Geom::all_nearest_times ( Point const &  p,
D2< SBasis > const &  c,
D2< SBasis > const &  dc,
double  from = 0,
double  to = 1 
)

◆ all_nearest_times() [2/4]

std::vector< double > Geom::all_nearest_times ( Point const &  p,
D2< SBasis > const &  c,
double  from = 0,
double  to = 1 
)
inline

Definition at line 95 of file nearest-time.h.

References all_nearest_times(), c, and derivative().

◆ all_nearest_times() [3/4]

std::vector< double > Geom::all_nearest_times ( Point const &  p,
Piecewise< D2< SBasis > > const &  c 
)
inline

Definition at line 124 of file nearest-time.h.

References all_nearest_times(), and c.

◆ all_nearest_times() [4/4]

std::vector< double > Geom::all_nearest_times ( Point const &  p,
Piecewise< D2< SBasis > > const &  c,
double  from,
double  to 
)

Definition at line 242 of file nearest-time.cpp.

References all_nearest_times(), bounds_fast(), c, and distanceSq().

◆ andrew_merge()

ConvexHull Geom::andrew_merge ( ConvexHull  a,
ConvexHull  b 
)

if we modified graham scan to work top to bottom as proposed in lect754.pdf we could replace the angle sort with a simple merge sort type algorithm. furthermore, we could do the graham scan online, avoiding a bunch of memory copies. That would probably be linear. – njh

Definition at line 707 of file convex-hull.cpp.

References Geom::ConvexHull::begin(), Geom::ConvexHull::end(), and result.

◆ angle_between() [1/3]

◆ angle_between() [2/3]

double Geom::angle_between ( Point const &  a,
Point const &  b 
)
related

◆ angle_between() [3/3]

double Geom::angle_between ( Ray const &  r1,
Ray const &  r2,
bool  cw = true 
)
inline

Definition at line 145 of file ray.h.

References angle_between(), and Geom::Ray::vector().

◆ append()

template<typename T >
void Geom::append ( T &  a,
T const &  b 
)

A little sugar for appending a list to another.

Definition at line 65 of file path-intersection.cpp.

Referenced by curve_mono_splits(), curve_self_crossings(), edges(), path_mono_splits(), and self_crossings().

◆ approx_min()

double Geom::approx_min ( std::vector< Point > const &  pts)

Definition at line 20 of file min-bbox-test.cpp.

References aligned_bbox(), area(), min(), and N.

Referenced by TEST().

◆ arc_from_sbasis()

bool Geom::arc_from_sbasis ( EllipticalArc ea,
D2< SBasis > const &  in,
double  tolerance,
unsigned  num_samples 
)
related

◆ arc_length_parametrization() [1/2]

◆ arc_length_parametrization() [2/2]

Piecewise< D2< SBasis > > Geom::arc_length_parametrization ( Piecewise< D2< SBasis > > const &  M,
unsigned  order = 3,
double  tol = .01 
)
related

◆ arcLengthSb() [1/2]

◆ arcLengthSb() [2/2]

Piecewise< SBasis > Geom::arcLengthSb ( Piecewise< D2< SBasis > > const &  M,
double  tol = .01 
)
related

◆ are_near() [1/14]

bool Geom::are_near ( Affine const &  a1,
Affine const &  a2,
Coord  eps = EPSILON 
)
related

Referenced by SPText::_adjustFontsizeRecursive(), Inkscape::UI::PathManipulator::_bsplineHandlePosition(), Inkscape::UI::PathManipulator::_bsplineHandleReposition(), Inkscape::UI::Tools::PenTool::_bsplineSpiroBuild(), Inkscape::UI::Tools::PenTool::_bsplineSpiroMotion(), Geom::SVGPathParser::_closePath(), Geom::PlanarGraph< EdgeLabel >::_compareAndReglue(), Geom::PlanarGraph< EdgeLabel >::_ensureVertexAt(), Inkscape::UI::Tools::PenTool::_finishSegment(), Inkscape::UI::Tools::PencilTool::_interpolate(), SPGenericEllipse::_isSlice(), Inkscape::UI::Tools::EraserTool::_isStraightSegment(), Inkscape::UI::ControlPointSelection::_keyboardScale(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), Geom::PlanarGraph< EdgeLabel >::_regularizeVertex(), Inkscape::CanvasItemGridAxonom::_render(), Inkscape::CanvasItemGuideLine::_render(), Inkscape::CanvasItemRect::_render(), Inkscape::CanvasItemGridAxonom::_update(), Inkscape::UI::TransformHandleSet::_updateVisibility(), Inkscape::UI::add_or_replace_if_extremum(), SPItem::adjust_stroke(), Geom::EllipticalArc::allNearestTimes(), SPViewBox::apply_viewbox(), Geom::Piecewise< T >::arc_length_parametrization(), Inkscape::LivePathEffect::are_colinear(), Geom::Affine::are_near(), are_near(), are_near(), Geom::Ellipse::are_near(), are_near(), are_near(), are_near(), are_near(), Inkscape::Util::are_near(), are_near(), are_near(), are_near(), are_near(), are_near(), Geom::Line::are_orthogonal(), are_parallel(), Geom::Line::are_same(), are_same(), bbox_on_rect_clip(), Inkscape::SubItem::build_mosaic(), cells(), Geom::xAx::centre(), Geom::CLIPPER_CLASS::clip(), Geom::Piecewise< T >::compose(), Geom::NearConcept< T >::constraints(), Geom::TransformConcept< T >::constraints(), count_path_degenerations(), SPGuide::createSPGuide(), Geom::SVGPathWriter::curveTo(), delete_duplicates(), dist_test(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doBeforeEffect(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPESlice::doBeforeEffect(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEBSpline::doBSplineFromWidget(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEOffset::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEFilletChamfer::doOnApply(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), Inkscape::PaperSize::findPaperSize(), Inkscape::Util::UnitTable::findUnit(), Inkscape::LivePathEffect::LPEShowHandles::generateHelperPath(), Inkscape::LivePathEffect::LPESimplify::generateHelperPathAndSmooth(), get_nodetype(), get_scale_transform_for_uniform_stroke(), get_scale_transform_for_variable_stroke(), Inkscape::LivePathEffect::getNodes(), grid_item_sort(), SnapManager::guideFreeSnap(), Inkscape::UI::PathManipulator::insertNodeAtExtremum(), Geom::CLIPPER_CLASS::intersect(), intersection(), intersection(), Geom::detail::intersection_impl(), Geom::detail::intersection_impl(), Geom::detail::intersection_impl(), intersection_point(), intersection_point(), IntersectionsValid(), Geom::detail::bezier_clipping::is_constant(), is_straight_curve(), Geom::Point::is_unit_vector(), Geom::Linear::isConstant(), Geom::Bezier::isConstant(), SPDesktop::DesktopAffine::isFlipped(), Geom::BezierCurve::isNear(), Geom::EllipticalArc::isNear(), Inkscape::LivePathEffect::Effect::isNodePointSelected(), Geom::Parallelogram::isSheared(), Geom::Linear::isZero(), Geom::Bezier::isZero(), Geom::detail::bezier_clipping::iterate< intersection_point_tag >(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_set(), linear_intersect(), Geom::SVGPathWriter::lineTo(), make_angle_bisector_ray(), make_elliptical_arc(), Inkscape::Extension::Internal::TemplateBase::match_template_size(), Inkscape::Rubberband::move(), Inkscape::UI::Handle::move(), SPGuide::moveto(), Inkscape::Extension::Internal::Wmf::myMetaFileProc(), Geom::EllipticalArc::nearestTime(), object_distribute(), ObjectNear(), ObjectNotNear(), Inkscape::UI::Widget::RegisteredScalarUnit::on_value_changed(), Inkscape::outline_join(), parting_point(), path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), pathv_similar(), pathv_to_cubicbezier(), Inkscape::Extension::Internal::PrintEmf::pathv_to_rect(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), Geom::detail::bezier_clipping::pick_orientation_line(), Geom::detail::bezier_clipping::pick_orientation_line(), Inkscape::DrawingCache::prepare(), Geom::SVGPathWriter::quadTo(), PathVectorNodeSatellites::recalculateForNewPathVector(), Inkscape::Extension::Internal::PdfBuilder::TextContext::render_text(), Inkscape::LivePathEffect::LPEBendPath::resetDefaults(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Geom::xAx::set(), SPGuide::set(), Inkscape::UI::Widget::DashSelector::set_dash_pattern(), SPItem::set_item_transform(), Inkscape::Extension::Internal::PdfBuilder::PageContext::set_pagebox(), SPItem::setCenter(), Inkscape::DrawingGroup::setChildTransform(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::setDefaults(), Inkscape::DrawingPattern::setPatternToUserTransform(), Geom::Ray::setPoints(), Inkscape::UI::Handle::setPosition(), Inkscape::DrawingItem::setTransform(), Inkscape::UI::Node::setType(), Inkscape::LivePathEffect::size_nondegenerate(), Geom::Path::snapEnds(), SPGenericEllipse::snappoints(), Inkscape::LivePathEffect::sp_bspline_do_effect(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_svg_transform_write(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), touching_circle(), Geom::Curve::unitTangentAt(), unitTangentAt(), Inkscape::DrawingItem::update(), Inkscape::Extension::Internal::PrintEmf::vector_rect_alignment(), VectorNear(), and SPDesktop::zoom_quick().

◆ are_near() [2/14]

bool Geom::are_near ( Circle const &  a,
Circle const &  b,
Coord  eps = EPSILON 
)

Definition at line 307 of file circle.cpp.

References are_near(), Geom::Circle::center(), and Geom::Circle::radius().

◆ are_near() [3/14]

template<typename T >
bool Geom::are_near ( D2< T > const &  a,
D2< T > const &  b,
double  tol 
)
inline

Definition at line 191 of file d2.h.

References are_near().

◆ are_near() [4/14]

bool Geom::are_near ( Ellipse const &  a,
Ellipse const &  b,
Coord  precision 
)
related

Definition at line 736 of file ellipse.cpp.

◆ are_near() [5/14]

bool Geom::are_near ( HShear const &  a,
HShear const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 264 of file transforms.h.

References are_near(), and Geom::ShearBase< S >::factor().

◆ are_near() [6/14]

bool Geom::are_near ( Path const &  a,
Path const &  b,
Coord  precision = EPSILON 
)

Definition at line 1132 of file path.cpp.

References Geom::Path::size().

◆ are_near() [7/14]

bool Geom::are_near ( Point const &  _point,
Ray const &  _ray,
double  eps = EPSILON 
)
inline

Definition at line 132 of file ray.h.

References are_near(), and distance().

◆ are_near() [8/14]

bool Geom::are_near ( Point const &  p,
Line const &  line,
double  eps = EPSILON 
)
inline

Definition at line 420 of file line.h.

References are_near(), and distance().

◆ are_near() [9/14]

bool Geom::are_near ( Point const &  p,
LineSegment const &  seg,
double  eps = EPSILON 
)
inline

Definition at line 472 of file line.h.

References are_near(), and distance().

◆ are_near() [10/14]

bool Geom::are_near ( Rotate const &  a,
Rotate const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 224 of file transforms.h.

References are_near(), X, and Y.

◆ are_near() [11/14]

bool Geom::are_near ( Scale const &  a,
Scale const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 178 of file transforms.h.

References are_near(), X, and Y.

◆ are_near() [12/14]

bool Geom::are_near ( Translate const &  a,
Translate const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 140 of file transforms.h.

References are_near(), X, and Y.

◆ are_near() [13/14]

bool Geom::are_near ( VShear const &  a,
VShear const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 281 of file transforms.h.

References are_near(), and Geom::ShearBase< S >::factor().

◆ are_near() [14/14]

bool Geom::are_near ( Zoom const &  a,
Zoom const &  b,
Coord  eps = EPSILON 
)
inline

Definition at line 328 of file transforms.h.

References are_near(), Geom::Zoom::scale(), and Geom::Zoom::translation().

◆ are_near_rel()

bool Geom::are_near_rel ( Point const &  a,
Point const &  b,
double  eps = EPSILON 
)
inline

Test whether the relative distance between two points is less than some threshold.

Definition at line 409 of file point.h.

References Geom::Point::length(), and Geom::Point::x().

Referenced by Geom::EllipticalArc::_validateIntersection(), and TEST().

◆ are_parallel()

bool Geom::are_parallel ( Line const &  l1,
Line const &  l2,
double  eps = EPSILON 
)
inline

Definition at line 426 of file line.h.

References are_near(), cross(), and Geom::Line::vector().

Referenced by Geom::Line::are_same().

◆ are_same()

bool Geom::are_same ( Ray const &  r1,
Ray const &  r2,
double  eps = EPSILON 
)
inline

Definition at line 137 of file ray.h.

References are_near(), Geom::Ray::origin(), and Geom::Ray::vector().

Referenced by wrap_ray().

◆ area()

◆ at_infinity()

bool Geom::at_infinity ( Point const &  p)

Definition at line 681 of file conicsec.cpp.

References infinity(), X, and Y.

Referenced by Geom::xAx::set().

◆ atan2() [1/3]

Piecewise< SBasis > Geom::atan2 ( D2< SBasis > const &  vect,
double  tol = .01,
unsigned  order = 3 
)
related

◆ atan2() [2/3]

Piecewise< SBasis > Geom::atan2 ( Piecewise< D2< SBasis > >const &  vect,
double  tol = .01,
unsigned  order = 3 
)
related

◆ atan2() [3/3]

double Geom::atan2 ( Point const &  p)
related

◆ axis_time_to_angles()

static std::array< Coord, 2 > Geom::axis_time_to_angles ( Coord  t,
bool  vertical 
)
static

Convert curve time on the major axis to the corresponding angle parameters on a degenerate ellipse collapsed onto that axis.

Parameters
tThe curve time on the major axis of an ellipse.
verticalIf true, the major axis goes from angle -π/2 to +π/2; otherwise, the major axis connects angles π and 0.
Returns
The two angles at which the collapsed ellipse passes through the major axis point corresponding to the given time \(t \in [0, 1]\).

Definition at line 420 of file ellipse.cpp.

Referenced by double_axis_intersections().

◆ below_x_monotonic_polyline()

template<typename Iter , typename Lex >
bool Geom::below_x_monotonic_polyline ( Point const &  p,
Iter  first,
Iter  last,
Lex  lex 
)

Definition at line 265 of file convex-hull.cpp.

References lerp(), X, and Y.

Referenced by Geom::ConvexHull::contains().

◆ bernstein_value_at()

template<typename T >
T Geom::bernstein_value_at ( double  t,
T const *  c_,
unsigned  n 
)
inline

Compute the value of a Bernstein-Bezier polynomial.

This method uses a Horner-like fast evaluation scheme.

Parameters
tTime value
c_Pointer to coefficients
nDegree of the polynomial (number of coefficients minus one)

Definition at line 55 of file bezier.h.

Referenced by Geom::BezierFitter::bezier_pt(), casteljau_subdivision(), TEST_F(), Geom::Bezier::valueAndDerivatives(), and Geom::Bezier::valueAt().

◆ between()

template<class T >
const T & Geom::between ( const T &  min,
const T &  max,
const T &  x 
)
inline

Between function - returns true if a number x is within a range: (min < x) && (max > x).

The values delimiting the range and the number must have the same type.

Definition at line 63 of file math-utils.h.

References max(), and min().

◆ bezier_expand_to_image() [1/4]

void Geom::bezier_expand_to_image ( Interval range,
Coord  x0,
Coord  x1,
Coord  x2 
)

Expand an interval to the image of a Bézier-Bernstein polynomial, assuming it already contains the initial point x0.

Definition at line 347 of file bezier.cpp.

References Geom::GenericInterval< C >::contains(), EPSILON, and Geom::GenericInterval< C >::expandTo().

Referenced by bezier_expand_to_image(), bezier_expand_to_image(), and Geom::BezierCurveN< degree >::expandToTransformed().

◆ bezier_expand_to_image() [2/4]

void Geom::bezier_expand_to_image ( Interval range,
Coord  x0,
Coord  x1,
Coord  x2,
Coord  x3 
)

◆ bezier_expand_to_image() [3/4]

static void Geom::bezier_expand_to_image ( Rect range,
Point const &  x0,
Point const &  x1,
Point const &  x2 
)
static

Definition at line 628 of file bezier-curve.cpp.

References bezier_expand_to_image(), X, and Y.

◆ bezier_expand_to_image() [4/4]

static void Geom::bezier_expand_to_image ( Rect range,
Point const &  x0,
Point const &  x1,
Point const &  x2,
Point const &  x3 
)
static

Definition at line 635 of file bezier-curve.cpp.

References bezier_expand_to_image(), X, and Y.

◆ bezier_fit_cubic() [1/2]

int Geom::bezier_fit_cubic ( Point bezier,
Point const *  data,
int  len,
double  error 
)

Fit a single-segment Bezier curve to a set of digitized points.

Returns
Number of segments generated, or -1 on error.

Definition at line 109 of file bezier-utils.cpp.

References bezier_fit_cubic_r(), data, and len.

◆ bezier_fit_cubic() [2/2]

int Geom::bezier_fit_cubic ( Point  bezier[],
Point const  data[],
int  len,
double  error 
)

◆ bezier_fit_cubic_full()

int Geom::BezierFitter::bezier_fit_cubic_full ( Point  bezier[],
int  split_points[],
Point const  data[],
int const  len,
Point const &  tHat1,
Point const &  tHat2,
double const  error,
unsigned const  max_beziers 
)

Fit a multi-segment Bezier curve to a set of digitized points, without possible weedout of identical points and NaNs.

Precondition
data is uniqued, i.e. not exist i: data[i] == data[i + 1].
Parameters
max_beziersMaximum number of generated segments
Resultarray, must be large enough for n. segments * 4 elements.

Definition at line 192 of file bezier-utils.cpp.

References bezier_fit_cubic_full(), chord_length_parameterize(), compute_max_error_ratio(), darray_center_tangent(), data, distance(), generate_bezier(), is_zero(), len, reparameterize(), sqrt(), and unconstrained_tangent.

Referenced by Inkscape::UI::Tools::PencilTool::_fitAndSplit(), bezier_fit_cubic_full(), bezier_fit_cubic_r(), and SPSpiral::fitAndDraw().

◆ bezier_fit_cubic_r()

int Geom::BezierFitter::bezier_fit_cubic_r ( Point  bezier[],
Point const  data[],
int const  len,
double const  error,
unsigned const  max_beziers 
)

Fit a multi-segment Bezier curve to a set of digitized points, with possible weedout of identical points and NaNs.

Parameters
max_beziersMaximum number of generated segments
Resultarray, must be large enough for n. segments * 4 elements.
Returns
Number of segments generated, or -1 on error.

Definition at line 124 of file bezier-utils.cpp.

References bezier_fit_cubic_full(), copy_without_nans_or_adjacent_duplicates(), data, len, and unconstrained_tangent.

Referenced by Inkscape::UI::Tools::EraserTool::_completeBezier(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), bezier_fit_cubic(), Inkscape::UI::Tools::CalligraphicTool::fit_and_split(), Geom::Interpolate::CubicBezierFit::interpolateToPath(), interpolateToPath(), interpolateToPath2(), main(), and ordered_fit().

◆ bezier_length() [1/3]

Coord Geom::bezier_length ( Point  p0,
Point  p1,
Point  p2,
Coord  tolerance = 0.01 
)

Compute the length of a quadratic bezier curve given by its control points.

Definition at line 774 of file bezier-curve.cpp.

References bezier_length_internal().

◆ bezier_length() [2/3]

Coord Geom::bezier_length ( Point  p0,
Point  p1,
Point  p2,
Point  p3,
Coord  tolerance = 0.01 
)

Compute the length of a cubic bezier curve given by its control points.

Definition at line 803 of file bezier-curve.cpp.

References bezier_length_internal().

◆ bezier_length() [3/3]

Coord bezier_length ( std::vector< Point > const &  points,
Coord  tolerance = 0.01 
)

Compute the length of a bezier curve given by a vector of its control points.

Definition at line 746 of file bezier-curve.cpp.

Referenced by Inkscape::UI::Node::_linearGrow().

◆ bezier_length_internal() [1/3]

static Coord Geom::bezier_length_internal ( Point  a0,
Point  a1,
Point  a2,
Coord  tolerance,
int  level 
)
static

Definition at line 753 of file bezier-curve.cpp.

References bezier_length_internal(), and distance().

◆ bezier_length_internal() [2/3]

static Coord Geom::bezier_length_internal ( Point  a0,
Point  a1,
Point  a2,
Point  a3,
Coord  tolerance,
int  level 
)
static

Definition at line 779 of file bezier-curve.cpp.

References bezier_length_internal(), and distance().

◆ bezier_length_internal() [3/3]

static Coord Geom::bezier_length_internal ( std::vector< Point > &  v1,
Coord  tolerance,
int  level 
)
static

◆ bezier_line_intersections()

template<unsigned degree>
static std::vector< CurveIntersection > Geom::bezier_line_intersections ( BezierCurveN< degree > const &  curve,
Line const &  line 
)
static

Find intersections of a low-degree Bézier curve with a line segment.

Uses algebraic solutions to low-degree polynomial equations which may be faster and more precise than iterative methods.

Template Parameters
degreeThe degree of the Bézier curve; must be 2 or 3.
Parameters
curveA Bézier curve of the given degree.
lineA line (but really a segment).
Returns
Intersections between the passed curve and the fundamental segment of the line (the segment where the time parameter lies in the unit interval).

Definition at line 509 of file bezier-curve.cpp.

References degree, distance(), Geom::Line::finalPoint(), Geom::Line::initialPoint(), length(), result, root, roots(), Geom::Line::rotationToZero(), solve_cubic(), solve_quadratic(), X, and Y.

◆ bezier_points()

std::vector< Point > Geom::bezier_points ( const D2< Bezier > &  a)
inline

Definition at line 352 of file bezier.h.

References result.

Referenced by Geom::BezierCurve::controlPoints(), find_intersections(), and sbasis_to_bezier().

◆ bezier_pt()

Point Geom::bezier_pt ( unsigned const  degree,
Point const  V[],
double const  t 
)

Evaluate a Bezier curve at parameter value t.

Parameters
degreeThe degree of the Bezier curve: 3 for cubic, 2 for quadratic etc. Must be less than 4.
VThe control points for the Bezier curve. Must have (degree+1) elements.
tThe "parameter" value, specifying whereabouts along the curve to evaluate. Typically in the range [0.0, 1.0].

Let s = 1 - t. BezierII(1, V) gives (s, t) * V, i.e. t of the way from V[0] to V[1]. BezierII(2, V) gives (s**2, 2*s*t, t**2) * V. BezierII(3, V) gives (s**3, 3 s**2 t, 3s t**2, t**3) * V.

The derivative of BezierII(i, V) with respect to t is i * BezierII(i-1, V'), where for all j, V'[j] = V[j + 1] - V[j].

Pascal's triangle.

Pascal's triangle.

Definition at line 666 of file bezier-utils.cpp.

References degree.

Referenced by compute_hook(), compute_max_error_ratio(), and NewtonRaphsonRootFind().

◆ bezier_to_sbasis() [1/4]

SBasis Geom::bezier_to_sbasis ( Bezier const &  B)

◆ bezier_to_sbasis() [2/4]

SBasis Geom::bezier_to_sbasis ( Coord const *  handles,
unsigned  order 
)
inline

◆ bezier_to_sbasis() [3/4]

void Geom::bezier_to_sbasis ( D2< SBasis > &  sb,
std::vector< Point > const &  bz 
)

Changes the basis of d2 p to be sbasis.

Parameters
pthe d2 Bernstein basis polynomial
Returns
the d2 Symmetric basis polynomial

if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order

Definition at line 377 of file sbasis-to-bezier.cpp.

References binomial_decrement_n(), binomial_increment_k(), X, and Y.

◆ bezier_to_sbasis() [4/4]

void Geom::bezier_to_sbasis ( SBasis sb,
Bezier const &  bz 
)

Changes the basis of p to be sbasis.

Parameters
pthe Bernstein basis polynomial
Returns
the Symmetric basis polynomial

if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order

Definition at line 318 of file sbasis-to-bezier.cpp.

References binomial_decrement_n(), binomial_increment_k(), Geom::SBasis::clear(), Geom::Bezier::order(), and Geom::SBasis::resize().

◆ binomial_coefficients()

void Geom::binomial_coefficients ( std::vector< size_t > &  bc,
std::size_t  n 
)

Definition at line 40 of file utils.cpp.

Referenced by Geom::NL::LFMBezier::LFMBezier().

◆ binomial_decrement_k()

template<typename T >
constexpr void Geom::binomial_decrement_k ( T &  b,
int  n,
int  k 
)
constexpr

Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k - 1).

Definition at line 70 of file choose.h.

Referenced by Geom::detail::bezier_clipping::distance_control_points().

◆ binomial_decrement_n()

template<typename T >
constexpr void Geom::binomial_decrement_n ( T &  b,
int  n,
int  k 
)
constexpr

Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n - 1, k).

Definition at line 52 of file choose.h.

Referenced by bezier_to_sbasis(), and bezier_to_sbasis().

◆ binomial_increment_k()

template<typename T >
constexpr void Geom::binomial_increment_k ( T &  b,
int  n,
int  k 
)
constexpr

◆ binomial_increment_n()

template<typename T >
constexpr void Geom::binomial_increment_n ( T &  b,
int  n,
int  k 
)
constexpr

Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n + 1, k).

Definition at line 43 of file choose.h.

◆ bounds() [1/2]

template<typename C >
std::vector< Rect > Geom::bounds ( C const &  a)

Definition at line 131 of file crossing.h.

References rs.

◆ bounds() [2/2]

std::vector< Rect > Geom::bounds ( Path const &  a)

Definition at line 117 of file crossing.cpp.

References Geom::Path::boundsFast(), rs, and Geom::Path::size_default().

◆ bounds_exact() [1/4]

◆ bounds_exact() [2/4]

template<typename T >
OptRect Geom::bounds_exact ( const D2< T > &  a)

Definition at line 475 of file d2.h.

References bounds_exact(), X, and Y.

◆ bounds_exact() [3/4]

OptRect Geom::bounds_exact ( PathVector const &  pv)
inline

Definition at line 287 of file pathvector.h.

References Geom::PathVector::boundsExact().

◆ bounds_exact() [4/4]

OptInterval Geom::bounds_exact ( SBasis const &  a)

◆ bounds_fast() [1/5]

◆ bounds_fast() [2/5]

template<typename T >
OptRect Geom::bounds_fast ( const D2< T > &  a)

Definition at line 470 of file d2.h.

References bounds_fast(), X, and Y.

◆ bounds_fast() [3/5]

OptRect Geom::bounds_fast ( D2< SBasis > const &  s,
unsigned  order = 0 
)
inline

Definition at line 525 of file d2.h.

References bounds_fast(), order, X, and Y.

◆ bounds_fast() [4/5]

OptRect Geom::bounds_fast ( PathVector const &  pv)
inline

Definition at line 286 of file pathvector.h.

References Geom::PathVector::boundsFast().

◆ bounds_fast() [5/5]

OptInterval Geom::bounds_fast ( SBasis const &  a,
int  order = 0 
)

◆ bounds_local() [1/4]

◆ bounds_local() [2/4]

template<typename T >
OptRect Geom::bounds_local ( const D2< T > &  a,
const OptInterval t 
)

Definition at line 480 of file d2.h.

References bounds_local(), X, and Y.

◆ bounds_local() [3/4]

OptRect Geom::bounds_local ( D2< SBasis > const &  s,
OptInterval  i,
unsigned  order = 0 
)
inline

Definition at line 536 of file d2.h.

References bounds_local(), order, X, and Y.

◆ bounds_local() [4/4]

OptInterval Geom::bounds_local ( SBasis const &  a,
const OptInterval t,
int  order = 0 
)

◆ boxprod()

static double Geom::boxprod ( Point  a,
Point  b,
Point  c 
)
static

Definition at line 80 of file conicsec.cpp.

References c, and det().

Referenced by Geom::RatQuad::fromPointsTangents().

◆ bridges()

std::vector< pair< int, int > > Geom::bridges ( ConvexHull  a,
ConvexHull  b 
)

find bridging pairs between two convex hulls.

this code is based on Hormoz Pirzadeh's masters thesis. There is room for optimisation:

  1. reduce recomputation
  2. use more efficient angle code
  3. write as iterator

Definition at line 543 of file convex-hull.cpp.

References angle_between(), atan2(), same_side(), and Geom::ConvexHull::size().

Referenced by merge().

◆ build_from_sbasis()

void Geom::build_from_sbasis ( Geom::PathBuilder pb,
D2< SBasis > const &  B,
double  tol,
bool  only_cubicbeziers 
)

Make a path from a d2 sbasis.

Parameters
pthe d2 Symmetric basis polynomial
Returns
a Path

If only_cubicbeziers is true, the resulting path may only contain CubicBezier curves.

Definition at line 497 of file sbasis-to-bezier.cpp.

References Geom::D2< T >::at1(), build_from_sbasis(), compose(), Geom::PathIteratorSink< OutputIterator >::curveTo(), Geom::D2< T >::isFinite(), Geom::PathIteratorSink< OutputIterator >::lineTo(), sbasis_size(), sbasis_to_cubic_bezier(), and tail_error().

Referenced by build_from_sbasis(), path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and path_from_sbasis().

◆ casteljau_subdivision()

template<typename T >
T Geom::casteljau_subdivision ( double  t,
T const *  v,
T *  left,
T *  right,
unsigned  order 
)
inline

Perform Casteljau subdivision of a Bezier polynomial.

Given an array of coefficients and a time value, computes two new Bernstein-Bezier basis polynomials corresponding to the \([0, t]\) and \([t, 1]\) intervals of the original one.

Parameters
tTime value
vArray of input coordinates
leftOutput polynomial corresponding to \([0, t]\)
rightOutput polynomial corresponding to \([t, 1]\)
orderOrder of the input polynomial, equal to one less the number of coefficients
Returns
Value of the polynomial at t

Definition at line 78 of file bezier.h.

References bernstein_value_at(), lerp(), and order.

Referenced by find_parametric_bezier_roots().

◆ centroid() [1/2]

unsigned Geom::centroid ( Piecewise< D2< SBasis > > const &  p,
Point centroid,
double &  area 
)
related

◆ centroid() [2/2]

int Geom::centroid ( std::vector< Geom::Point > const &  p,
Geom::Point centroid,
double &  area 
)

polyCentroid: Calculates the centroid (xCentroid, yCentroid) and area of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]).

It is assumed that the contour is closed, i.e., that the vertex following (x[n-1], y[n-1]) is (x[0], y[0]). The algebraic sign of the area is positive for counterclockwise ordering of vertices in x-y plane; otherwise negative.

Returned values: 0 for normal execution; 1 if the polygon is degenerate (number of vertices < 3); 2 if area = 0 (and the centroid is undefined).

for now we require the path to be a polyline and assume it is closed.

Definition at line 366 of file geom.cpp.

References area(), centroid(), and cross().

Referenced by Geom::Piecewise< T >::centroid(), centroid(), Geom::PlanarGraph< EdgeLabel >::closedPathArea(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), draw_cell(), Inkscape::is_path_empty(), path_direction(), and pwd2sb_centroid().

◆ cheb()

SBasis Geom::cheb ( unsigned  n)

Definition at line 14 of file chebyshev.cpp.

References basis(), and Geom::SBasis::push_back().

Referenced by cheb_series().

◆ cheb_series()

SBasis Geom::cheb_series ( unsigned  n,
double *  cheb_coeff 
)

Definition at line 27 of file chebyshev.cpp.

References cheb().

◆ chebyshev()

SBasis Geom::chebyshev ( unsigned  n)

Definition at line 102 of file chebyshev.cpp.

References basis(), and Geom::SBasis::push_back().

◆ chebyshev_approximant()

SBasis Geom::chebyshev_approximant ( double(*)(double, void *)  f,
int  order,
Interval  in,
void *  p = 0 
)

Definition at line 59 of file chebyshev.cpp.

References clenshaw_series(), compose(), and order.

Referenced by chebyshev_approximant_interpolating().

◆ chebyshev_approximant_interpolating()

SBasis Geom::chebyshev_approximant_interpolating ( double(*)(double, void *)  f,
int  order,
Interval  in,
void *  p = 0 
)

Definition at line 88 of file chebyshev.cpp.

References chebyshev_approximant(), compose(), f_interp(), and order.

◆ check_transforms()

◆ choose()

template<typename T >
constexpr T Geom::choose ( unsigned  n,
unsigned  k 
)
constexpr

Calculate the (n, k)th binomial coefficient.

Definition at line 79 of file choose.h.

References binomial_increment_k(), and max().

◆ chord_length_parameterize()

static void Geom::chord_length_parameterize ( Point const  d[],
double  u[],
unsigned const  len 
)
static

Assign parameter values to digitized points using relative distances between points.

Precondition
Parameter array u must have space for len items.
Todo:
It's been reported that u[len - 1] can differ from 1.0 on some systems (amd64), despite it having been calculated as x / x where x is isFinite and non-zero.
Todo:
It's been reported that u[len - 1] can differ from 1.0 on some systems (amd64), despite it having been calculated as x / x where x is isFinite and non-zero.

Definition at line 833 of file bezier-utils.cpp.

References distance(), and len.

Referenced by bezier_fit_cubic_full().

◆ clean()

void Geom::clean ( Crossings cr_a,
Crossings cr_b 
)

Definition at line 202 of file crossing.cpp.

◆ cleanup_and_fuse()

static void Geom::cleanup_and_fuse ( std::vector< SmashIntersection > &  inters)
static

Definition at line 133 of file intersection-by-smashing.cpp.

References compareIntersectionsTimesX(), intersects, X, and Y.

Referenced by smash_intersect().

◆ clenshaw_series()

SBasis Geom::clenshaw_series ( unsigned  m,
double *  cheb_coeff 
)

b_n = a_n b_n-1 = 2*x*b_n + a_n-1 b_n-k = 2*x*b_{n-k+1} + a_{n-k} - b_{n - k + 2} b_0 = x*b_1 + a_0 - b_2

Definition at line 39 of file chebyshev.cpp.

Referenced by chebyshev_approximant().

◆ clip() [1/2]

std::optional< LineSegment > Geom::clip ( Line const &  l,
Rect const &  r 
)
inline

Definition at line 526 of file line.h.

References Geom::Line::clip().

◆ clip() [2/2]

bool Geom::clip ( std::vector< RatQuad > &  rq,
const xAx cs,
const Rect R 
)

◆ compareIntersectionsTimesX()

static bool Geom::compareIntersectionsTimesX ( SmashIntersection const &  inter1,
SmashIntersection const &  inter2 
)
static

◆ compose() [1/18]

D2< SBasis > Geom::compose ( D2< SBasis > const &  a,
SBasis const &  b 
)
inline

Definition at line 489 of file d2.h.

References compose(), X, and Y.

◆ compose() [2/18]

template<typename T >
D2< T > Geom::compose ( D2< T > const &  a,
T const &  b 
)
inline

Definition at line 405 of file d2.h.

References compose().

Referenced by Geom::Piecewise< T >::arc_length_parametrization(), bend(), Inkscape::LivePathEffect::bend(), build_from_sbasis(), chebyshev_approximant(), chebyshev_approximant_interpolating(), compose(), compose(), compose(), compose(), compose(), compose(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::compose(), compose(), compose(), compose(), compose(), compose(), compose(), compose(), compose_each(), compose_each(), compose_each(), convole(), convole(), cos(), divide(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), doEffect_pwd2(), main(), monotonic_smash_intersect(), Geom::Piecewise< T >::operator()(), Geom::SBasis::operator()(), Geom::Piecewise< T >::operator()(), Geom::SBasisOf< T >::operator()(), plot3d(), plot3d(), plot3d_top(), Geom::SBasis::portion(), portion(), portion(), Geom::Piecewise< T >::pw_compose_inverse(), reciprocal(), reciprocal(), recursive_curvature_fitter(), sb2d_cubic_solve(), sb2dsolve(), sbofsb_cubic_solve(), single_curvature_fitter(), smash_intersect(), solve_lambda0(), sqrt_internal(), Inkscape::LivePathEffect::stretch_along(), Geom::Piecewise< T >::unitVector(), and wrap_sbasis().

◆ compose() [3/18]

SBasis Geom::compose ( Linear2d const &  a,
D2< SBasis > const &  p 
)

Definition at line 40 of file sbasis-2d.cpp.

References multiply(), X, and Y.

◆ compose() [4/18]

template<unsigned m, unsigned n>
SBasisN< m > Geom::compose ( LinearN< n > const &  f,
std::vector< SBasisN< m > > const &  t,
unsigned  fixed = 0,
unsigned  flags = 0 
)

Definition at line 958 of file sbasisN.h.

References compose().

◆ compose() [5/18]

template<typename T >
SBasisOf< T > Geom::compose ( LinearOf< T > const &  a,
LinearOf< T > const &  b 
)

Definition at line 595 of file sbasis-of.h.

References compose().

◆ compose() [6/18]

template<typename T >
SBasisOf< T > Geom::compose ( LinearOf< T > const &  a,
SBasisOf< T > const &  b 
)

Definition at line 587 of file sbasis-of.h.

References compose().

◆ compose() [7/18]

Poly Geom::compose ( Poly const &  a,
Poly const &  b 
)

Definition at line 157 of file polynomial.cpp.

References result.

◆ compose() [8/18]

SBasis Geom::compose ( SBasis const &  a,
SBasis const &  b 
)

Compute a composed with b.

Parameters
a,bsbasis functions
Returns
sbasis a(b(t))

return a0 + s(a1 + s(a2 +... where s = (1-u)u; ak =(1 - u)a^0_k + ua^1_k

Definition at line 448 of file sbasis.cpp.

References multiply(), multiply_add(), and Geom::SBasis::size().

◆ compose() [9/18]

SBasis Geom::compose ( SBasis const &  a,
SBasis const &  b,
unsigned  k 
)

Compute a composed with b to k terms.

Parameters
a,bsbasis functions
Returns
sbasis a(b(t))

return a0 + s(a1 + s(a2 +... where s = (1-u)u; ak =(1 - u)a^0_k + ua^1_k

Definition at line 464 of file sbasis.cpp.

References multiply(), multiply_add(), Geom::SBasis::size(), and Geom::SBasis::truncate().

◆ compose() [10/18]

SBasis2d Geom::compose ( SBasis2d const &  a,
SBasis2d const &  b 
)

◆ compose() [11/18]

SBasis2d Geom::compose ( SBasis2d const &  a,
SBasis2d const &  b,
unsigned  k 
)

◆ compose() [12/18]

SBasis Geom::compose ( SBasis2d const &  fg,
D2< SBasis > const &  p 
)

Definition at line 49 of file sbasis-2d.cpp.

References compose(), Geom::SBasis2d::us, and Geom::SBasis2d::vs.

◆ compose() [13/18]

template<unsigned n>
SBasisN< n > Geom::compose ( SBasisN< n > const &  a,
SBasisN< n > const &  b 
)

◆ compose() [14/18]

template<unsigned n>
SBasisN< n > Geom::compose ( SBasisN< n > const &  a,
SBasisN< n > const &  b,
unsigned  k 
)

◆ compose() [15/18]

template<unsigned m, unsigned n>
SBasisN< m > Geom::compose ( SBasisN< n > const &  f,
std::vector< SBasisN< m > > const &  t,
unsigned const  k = 0,
unsigned const  idx = 0 
)

Definition at line 970 of file sbasisN.h.

References compose(), multiply(), and Geom::SBasisN< n >::sizes.

◆ compose() [16/18]

template<typename T >
SBasisOf< T > Geom::compose ( SBasisOf< T > const &  a,
LinearOf< T > const &  b 
)

Definition at line 591 of file sbasis-of.h.

References compose().

◆ compose() [17/18]

template<typename T >
SBasisOf< T > Geom::compose ( SBasisOf< T > const &  a,
SBasisOf< T > const &  b 
)

Definition at line 565 of file sbasis-of.h.

References multiply(), and multiply_add().

◆ compose() [18/18]

template<typename T >
SBasisOf< T > Geom::compose ( SBasisOf< T > const &  a,
SBasisOf< T > const &  b,
unsigned  k 
)

Definition at line 576 of file sbasis-of.h.

References multiply(), multiply_add(), and Geom::SBasisOf< T >::truncate().

◆ compose_each() [1/3]

D2< SBasis > Geom::compose_each ( D2< SBasis2d > const &  fg,
D2< SBasis > const &  p 
)

Definition at line 69 of file sbasis-2d.cpp.

References compose(), X, and Y.

◆ compose_each() [2/3]

template<typename T >
D2< T > Geom::compose_each ( D2< T > const &  a,
D2< T > const &  b 
)
inline

◆ compose_each() [3/3]

template<typename T >
D2< T > Geom::compose_each ( T const &  a,
D2< T > const &  b 
)
inline

Definition at line 423 of file d2.h.

References compose().

◆ compose_findSegIdx()

int Geom::compose_findSegIdx ( std::map< double, unsigned >::iterator const &  cut,
std::map< double, unsigned >::iterator const &  next,
std::vector< double > const &  levels,
SBasis const &  g 
)

Definition at line 130 of file piecewise.cpp.

Referenced by Geom::Piecewise< T >::compose().

◆ compose_inverse() [1/2]

SBasis Geom::compose_inverse ( SBasis const &  f,
SBasis const &  g,
unsigned  order,
double  zero 
)

compute fog^-1.

Parameters
f,gsbasis functions
Returns
sbasis f(g^-1(t)).

("zero" = double comparison threshold. !*we might divide by "zero"!*) TODO: compute order according to tol? TODO: requires g(0)=0 & g(1)=1 atm... adaptation to other cases should be obvious!

Definition at line 623 of file sbasis.cpp.

References Geom::SBasis::at(), det(), order, Geom::SBasis::resize(), result, Geom::SBasis::truncate(), and valuation().

◆ compose_inverse() [2/2]

template<unsigned n>
SBasisN< n > Geom::compose_inverse ( SBasisN< n > const &  f,
SBasisN< n > const &  g,
unsigned  order = 2,
double  tol = 1e-3 
)

◆ compose_pullback()

std::map< double, unsigned > Geom::compose_pullback ( std::vector< double > const &  cuts,
SBasis const &  g 
)

◆ compute_hook()

static double Geom::compute_hook ( Point const &  a,
Point const &  b,
double const  u,
Point const  bezCurve[],
double const  tolerance 
)
static

Whereas compute_max_error_ratio() checks for itself that each data point is near some point on the curve, this function checks that each point on the curve is near some data point (or near some point on the polyline defined by the data points, or something like that: we allow for a "reasonable curviness" from such a polyline).

"Reasonable curviness" means we draw a circle centred at the midpoint of a..b, of radius proportional to the length |a - b|, and require that each point on the segment of bezCurve between the parameters of a and b be within that circle. If any point P on the bezCurve segment is outside of that allowable region (circle), then we return some metric that increases with the distance from P to the circle.

Given that this is a fairly arbitrary criterion for finding appropriate places for sharp corners, we test only one point on bezCurve, namely the point on bezCurve with parameter halfway between our estimated parameters for a and b. (Alternatives are taking the farthest of a few parameters between those of a and b, or even using a variant of NewtonRaphsonFindRoot() for finding the maximum rather than minimum distance.)

Todo:
effic: Hooks are very rare. We could start by comparing distsq, only resorting to the more expensive L2 in cases of uncertainty.
Todo:
effic: Hooks are very rare. We could start by comparing distsq, only resorting to the more expensive L2 in cases of uncertainty.

Definition at line 969 of file bezier-utils.cpp.

References bezier_pt(), and distance().

Referenced by compute_max_error_ratio().

◆ compute_max_error_ratio()

static double Geom::compute_max_error_ratio ( Point const  d[],
double const  u[],
unsigned const  len,
Point const  bezCurve[],
double const  tolerance,
unsigned *const  splitPoint 
)
static

Find the maximum squared distance of digitized points to fitted curve, and (if this maximum error is non-zero) set *splitPoint to the corresponding index.

Precondition
2 <= len.
u[0] == 0.
u[len - 1] == 1.0.
Postcondition
((ret == 0.0) || ((*splitPoint < len - 1) && (*splitPoint != 0 || ret < 0.0))).

Definition at line 898 of file bezier-utils.cpp.

References bezier_pt(), compute_hook(), len, lensq(), and sqrt().

Referenced by bezier_fit_cubic_full().

◆ compute_x_intercept()

static double Geom::compute_x_intercept ( Geom::Point const *  V,
unsigned  degree 
)
static

Definition at line 170 of file solve-bezier-parametric.cpp.

References degree, X, and Y.

Referenced by find_parametric_bezier_roots().

◆ computeLinfinityNeighborhood() [1/2]

static void Geom::computeLinfinityNeighborhood ( D2< SBasis > const &  f,
double  tol,
D2< Piecewise< SBasis > > &  topside,
D2< Piecewise< SBasis > > &  botside 
)
static

◆ computeLinfinityNeighborhood() [2/2]

◆ concept_checks()

void Geom::concept_checks ( )

Definition at line 49 of file concepts.cpp.

◆ constrain_angle()

Point Geom::constrain_angle ( Point const &  A,
Point const &  B,
unsigned  n = 4,
Point const &  dir = {1, 0} 
)

◆ contains()

◆ control_poly_flat_enough()

static unsigned Geom::control_poly_flat_enough ( Geom::Point const *  V,
unsigned  degree 
)
static

Definition at line 109 of file solve-bezier-parametric.cpp.

References BEPSILON, c, degree, distance(), X, and Y.

Referenced by find_parametric_bezier_roots().

◆ copy_without_nans_or_adjacent_duplicates()

static unsigned Geom::copy_without_nans_or_adjacent_duplicates ( Point const  src[],
unsigned  src_len,
Point  dest[] 
)
static

Copy points from src to dest, filter out points containing NaN and adjacent points with equal x and y.

Returns
length of dest

Definition at line 154 of file bezier-utils.cpp.

References X, and Y.

Referenced by bezier_fit_cubic_r().

◆ cos() [1/4]

SBasis Geom::cos ( Linear  bo,
int  k 
)

Compute the cosine of a.

Parameters
blinear function
Returns
sbasis cos(a)

It is recommended to use the piecewise version unless you have good reason.

Definition at line 609 of file sbasis.cpp.

References sin().

◆ cos() [2/4]

◆ cos() [3/4]

Piecewise< SBasis > Geom::cos ( Piecewise< SBasis > const &  f,
double  tol,
int  order 
)

Compute the cosine of a function.

Parameters
ffunction
tolmaximum error
ordermaximum degree polynomial to use

Definition at line 222 of file sbasis-math.cpp.

References cos(), Geom::Piecewise< T >::cuts, order, result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), and Geom::Piecewise< T >::size().

◆ cos() [4/4]

Piecewise< SBasis > Geom::cos ( SBasis const &  f,
double  tol,
int  order 
)

Compute the cosine of a function.

Parameters
ffunction
tolmaximum error
ordermaximum degree polynomial to use

Definition at line 237 of file sbasis-math.cpp.

References Geom::SBasis::at0(), Geom::SBasis::at1(), c, compose(), Geom::Piecewise< T >::concat(), cos(), order, Geom::Piecewise< T >::setDomain(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().

◆ cross()

Piecewise< SBasis > Geom::cross ( Piecewise< D2< SBasis > > const &  a,
Piecewise< D2< SBasis > > const &  b 
)

Definition at line 144 of file d2-sbasis.cpp.

References cross(), Geom::Piecewise< T >::cuts, result, and Geom::Piecewise< T >::segs.

Referenced by Inkscape::CanvasItemGridXY::_render(), ang(), Geom::Point::angle_between(), Geom::Ellipse::arc(), Inkscape::LivePathEffect::are_colinear(), are_parallel(), Geom::ConvexHull::area(), Geom::Piecewise< T >::centroid(), centroid(), Geom::Line::coefficients(), Inkscape::CanvasItemQuad::contains(), cross(), Geom::D2< T >::cubics_fitting_curvature(), cubics_fitting_curvature(), Geom::Piecewise< T >::curvature(), distance(), distanceLessThanOrEqual(), DistanceToCubic(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), find_ellipse(), Geom::D2< T >::find_tangents(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::genPerspectiveEllipse(), Inkscape::LivePathEffect::getAngle(), Geom::BezierCurveN< degree >::intersect(), Geom::Circle::intersect(), Geom::Line::intersect(), intersect(), Geom::detail::intersection_impl(), intersection_point(), intersection_point(), Geom::Circle::intersects(), Inkscape::LivePathEffect::LPEPts2Ellipse::is_ccw(), is_clockwise_turn(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), linear_intersect(), non_collinear_segments_intersect(), Geom::detail::bezier_clipping::orientation_line(), Inkscape::outline_join(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingGroup::SetEndpoints(), Inkscape::signed_distance(), signed_triangle_area(), SignedTriangleArea(), Inkscape::LivePathEffect::LPECopyRotate::split(), Inkscape::LivePathEffect::LPESlice::splititem(), Path::Surface(), touching_circle(), touching_circle(), triangulate(), and Geom::EllipticalArc::winding().

◆ crossing_count() [1/2]

unsigned Geom::crossing_count ( double const *  V,
unsigned  degree,
double  left_t,
double  right_t 
)

◆ crossing_count() [2/2]

unsigned Geom::crossing_count ( Geom::Point const *  V,
unsigned  degree 
)

Definition at line 85 of file solve-bezier-parametric.cpp.

References degree, sign(), and Y.

Referenced by find_parametric_bezier_roots().

◆ crossings() [1/3]

◆ crossings() [2/3]

Crossings Geom::crossings ( Path const &  a,
Path const &  b 
)
inline

Definition at line 95 of file path-intersection.h.

References c.

◆ crossings() [3/3]

CrossingSet Geom::crossings ( PathVector const &  a,
PathVector const &  b 
)
inline

Definition at line 100 of file path-intersection.h.

References c.

◆ crossings_among()

◆ cube()

template<class T >
T Geom::cube ( const T &  x)
inline

Definition at line 58 of file math-utils.h.

Referenced by Inkscape::Colors::Space::OkLab::toLinearRGB().

◆ cubic_bezier_poly_coeff()

template<typename iterator >
static void Geom::cubic_bezier_poly_coeff ( iterator  b,
Point pc 
)
static

Definition at line 65 of file bezier-utils.h.

References c.

◆ cubicbezierpath_from_sbasis()

◆ cubics_fitting_curvature() [1/2]

std::vector< D2< SBasis > > Geom::cubics_fitting_curvature ( Point const &  M0,
Point const &  M1,
Point const &  dM0,
Point const &  dM1,
double  d2M0xdM0,
double  d2M1xdM1,
int  insist_on_speed_signs = 1,
double  epsilon = 1e-5 
)
related

◆ cubics_fitting_curvature() [2/2]

std::vector< D2< SBasis > > Geom::cubics_fitting_curvature ( Point const &  M0,
Point const &  M1,
Point const &  dM0,
Point const &  dM1,
Point const &  d2M0,
Point const &  d2M1,
int  insist_on_speed_signs = 1,
double  epsilon = 1e-5 
)

Definition at line 716 of file sbasis-geometric.cpp.

References cross(), and cubics_fitting_curvature().

◆ cubics_with_prescribed_curvature()

std::vector< D2< SBasis > > Geom::cubics_with_prescribed_curvature ( Point const &  M0,
Point const &  M1,
Point const &  dM0,
Point const &  dM1,
double  k0,
double  k1,
int  insist_on_speed_signs = 1,
double  error = 1e-5 
)

Definition at line 727 of file sbasis-geometric.cpp.

References cubics_fitting_curvature(), Geom::Point::length(), and length().

◆ curvature() [1/2]

◆ curvature() [2/2]

Piecewise< SBasis > Geom::curvature ( Piecewise< D2< SBasis > > const &  M,
double  tol = .01 
)
related

◆ curve_mono_splits()

std::vector< double > Geom::curve_mono_splits ( Curve const &  d)

This returns the times when the x or y derivative is 0 in the curve.

Definition at line 388 of file path-intersection.cpp.

References append(), Geom::Curve::derivative(), Geom::Curve::roots(), rs, X, and Y.

Referenced by curve_self_crossings(), and path_mono_splits().

◆ curve_self_crossings()

Crossings Geom::curve_self_crossings ( Curve const &  a)

Definition at line 550 of file path-intersection.cpp.

References append(), curve_mono_splits(), and pair_intersect().

Referenced by self_crossings().

◆ curve_sweep()

template<typename T >
Crossings Geom::curve_sweep ( Path const &  a,
Path const &  b 
)

Definition at line 52 of file path-intersection.h.

References bounds, offset_crossings(), Geom::Path::size(), and sweep_bounds().

◆ cutAtRoots()

Piecewise< D2< SBasis > > Geom::cutAtRoots ( Piecewise< D2< SBasis > > const &  M,
double  tol = 1e-4 
)

◆ cyclic_next()

template<typename Iter , typename Container >
Iter Geom::cyclic_next ( Iter  i,
Container &  c 
)

◆ cyclic_prior()

template<typename Iter , typename Container >
Iter Geom::cyclic_prior ( Iter  i,
Container &  c 
)

Get the previous iterator in the container with wrap-around.

If the passed iterator is the begin iterator, return the iterator just before the end iterator instead.

Definition at line 93 of file utils.h.

References c.

Referenced by Geom::PathIntersectionGraph::_getResult(), Geom::PathIntersectionGraph::_removeDegenerateIntersections(), Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicPrevIncidence(), and Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicPrevIncidence().

◆ darray_center_tangent()

static Point Geom::darray_center_tangent ( Point const  d[],
unsigned const  center,
unsigned const  len 
)
static

Estimates the (backward) tangent at d[center], by averaging the two segments connected to d[center] (and then normalizing the result).

Note
The tangent is "backwards", i.e. it is with respect to decreasing index rather than increasing index.
Precondition
(0 < center < len - 1) and d is uniqued (at least in the immediate vicinity of center).

Definition at line 807 of file bezier-utils.cpp.

References len, Geom::Point::normalize(), and rot90().

Referenced by bezier_fit_cubic_full().

◆ darray_left_tangent() [1/2]

Point Geom::darray_left_tangent ( Point const  d[],
unsigned const  len 
)

Estimate the (forward) tangent at point d[first + 0.5].

Unlike the center and right versions, this calculates the tangent in the way one might expect, i.e., wrt increasing index into d.

Precondition
(2 <= len) and (d[0] != d[1]).

Definition at line 706 of file bezier-utils.cpp.

References len, and unit_vector().

Referenced by darray_left_tangent(), and generate_bezier().

◆ darray_left_tangent() [2/2]

Point Geom::darray_left_tangent ( Point const  d[],
unsigned const  len,
double const  tolerance_sq 
)

Estimate the (forward) tangent at point d[0].

Unlike the center and right versions, this calculates the tangent in the way one might expect, i.e., wrt increasing index into d.

Precondition
2 <= len.
d[0] != d[1].
all[p in d] in_svg_plane(p).
Postcondition
is_unit_vector(ret).

Definition at line 745 of file bezier-utils.cpp.

References darray_left_tangent(), dot(), len, and unit_vector().

◆ darray_right_tangent() [1/2]

static Point Geom::darray_right_tangent ( Point const  d[],
unsigned const  len 
)
static

Estimates the (backward) tangent at d[last - 0.5].

Note
The tangent is "backwards", i.e. it is with respect to decreasing index rather than increasing index.
Precondition
2 <= len.
d[len - 1] != d[len - 2].
all[p in d] in_svg_plane(p).

Definition at line 724 of file bezier-utils.cpp.

References len, and unit_vector().

◆ darray_right_tangent() [2/2]

Point Geom::darray_right_tangent ( Point const  d[],
unsigned const  len,
double const  tolerance_sq 
)

Estimates the (backward) tangent at d[last].

Note
The tangent is "backwards", i.e. it is with respect to decreasing index rather than increasing index.
Precondition
2 <= len.
d[len - 1] != d[len - 2].
all[p in d] in_svg_plane(p).

Definition at line 776 of file bezier-utils.cpp.

References darray_right_tangent(), dot(), len, and unit_vector().

Referenced by darray_right_tangent(), and generate_bezier().

◆ decimal_round()

double Geom::decimal_round ( double  x,
int  p 
)
inline

Returns x rounded to the nearest multiple of \(10^{p}\).

Implemented in terms of round, i.e. we make no guarantees as to what happens if x is half way between two rounded numbers.

Note: places is the number of decimal places without using scientific (e) notation, not the number of significant figures. This function may not be suitable for values of x whose magnitude is so far from 1 that one would want to use scientific (e) notation.

places may be negative: e.g. places = -2 means rounding to a multiple of .01

Definition at line 77 of file math-utils.h.

Referenced by angle_formatter().

◆ decompose_degenerate()

std::vector< Point > Geom::decompose_degenerate ( xAx const &  C1,
xAx const &  C2,
xAx const &  xC0 
)

At this point we have tried up to 4 points: 0,0, 1,0, 1,1, 2,1, 1.5,1.5

No degenerate conic can pass through these points, so we can assume that we've found a perpendicular to the double line. Proof: any degenerate must consist of at most 2 lines. 1.5,0.5 is not on any pair of lines passing through the previous 4 trials.

alternatively, there may be a way to determine this directly from xC0

Definition at line 238 of file conicsec.cpp.

References Geom::xAx::c, c, Geom::Affine::det(), det(), Geom::Line::from_origin_and_vector(), Geom::xAx::gradient(), Geom::xAx::hessian(), L1(), n1, Geom::Line::pointAt(), Geom::xAx::roots(), and rot90().

Referenced by intersect().

◆ delete_duplicates()

void Geom::delete_duplicates ( Crossings crs)

Definition at line 188 of file crossing.cpp.

References are_near().

Referenced by Inkscape::UI::Tools::calculate_intersections().

◆ derivative() [1/6]

Bezier Geom::derivative ( Bezier const &  a)

Definition at line 282 of file bezier.cpp.

Referenced by all_nearest_times(), arc_length_integrating(), Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Geom::Piecewise< T >::atan2(), bounds_exact(), Geom::BezierCurve::boundsLocal(), Geom::Piecewise< T >::centroid(), Geom::Piecewise< T >::curvature(), Geom::BezierCurve::derivative(), Geom::BezierCurveN< degree >::derivative(), Geom::SBasisCurve::derivative(), derivative(), Geom::Piecewise< T >::derivative(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Inkscape::LivePathEffect::LPETangentToCurve::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), doEffect_pwd2(), dot_plot(), dot_plot(), Geom::Path::extrema(), Inkscape::LivePathEffect::find_cusps(), Geom::D2< T >::find_normals(), Geom::D2< T >::find_normals_by_vector(), find_self_intersections(), Geom::D2< T >::find_tangents(), Geom::D2< T >::find_tangents_by_vector(), goal_function(), Geom::D2< T >::length_integrating(), linearizeCusps(), Inkscape::LivePathEffect::LPERoughHatches::linearSnake(), linearSnake(), main(), monotonic_smash_intersect(), monotonicSplit(), my_inverse(), naive_sb_seg_to_bez(), nearest_time(), nearest_time(), plot_offset(), polish_root(), sb_seg_to_bez(), sbofsb_cubic_solve(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), smash_intersect(), Inkscape::LivePathEffect::stretch_along(), subderivative(), TEST_F(), TEST_F(), Geom::BezierCurve::timesWithRadiusOfCurvature(), toPoly(), touching_circle(), and wrap_pw().

◆ derivative() [2/6]

template<typename T >
D2< T > Geom::derivative ( D2< T > const &  a)

Definition at line 452 of file d2.h.

References derivative(), X, and Y.

◆ derivative() [3/6]

Poly Geom::derivative ( Poly const &  p)

Definition at line 145 of file polynomial.cpp.

References result.

◆ derivative() [4/6]

SBasis Geom::derivative ( SBasis const &  a)

Compute the derivative of a (Exact)

Parameters
asbasis functions
Returns
sbasis da/dt

Definition at line 323 of file sbasis.cpp.

References c, Geom::SBasis::isZero(), Geom::SBasis::resize(), and Geom::SBasis::size().

◆ derivative() [5/6]

template<unsigned n>
SBasisN< n > Geom::derivative ( SBasisN< n > const &  a)

◆ derivative() [6/6]

template<typename T >
SBasisOf< T > Geom::derivative ( SBasisOf< T > const &  a)

Definition at line 506 of file sbasis-of.h.

References c, and Geom::SBasisOf< T >::isZero().

◆ det() [1/3]

◆ det() [2/3]

template<typename T >
static T Geom::det ( a,
b,
c,
d 
)
static

Definition at line 61 of file conicsec.cpp.

References c.

◆ det() [3/3]

template<typename T >
static T Geom::det ( M[2][2])
static

Definition at line 66 of file conicsec.cpp.

◆ det3()

template<typename T >
static T Geom::det3 ( M[3][3])
static

Definition at line 71 of file conicsec.cpp.

References det().

Referenced by Geom::xAx::categorise(), intersect(), xAx_descr(), and xAx_descr().

◆ dist_test()

template<typename Curve01T , typename CurveT >
unsigned int Geom::dist_test ( Piecewise< SBasis > const &  pwc,
Curve01T const &  A,
CurveT const &  B,
double  step 
)

Definition at line 707 of file curve-curve-distance.cpp.

References are_near(), distance(), and nearest_time().

◆ distance() [1/8]

Angle Geom::distance ( Angle const &  a,
Angle const &  b 
)
inline

Definition at line 163 of file angle.h.

References Geom::Angle::radians0().

Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Inkscape::UI::PathManipulator::_deleteStretch(), Inkscape::UI::ControlPointSelection::_pointDragged(), Inkscape::UI::ControlPointSelection::_pointGrabbed(), Inkscape::UI::ControlPointSelection::_rotationRadius(), Inkscape::ObjectSnapper::_snapPaths(), Inkscape::ObjectSnapper::_snapPathsTangPerp(), Inkscape::UI::PathManipulator::_updateDragPoint(), Inkscape::LivePathEffect::LPECopyRotate::addCanvasIndicators(), Inkscape::LivePathEffect::LPERoughen::addNodesAndJitter(), GrDrag::addStopNearPoint(), arc_length_integrating(), arc_length_subdividing(), Geom::Ellipse::are_near(), are_near(), are_near(), are_near(), bezier_fit_cubic_full(), Geom::BezierFitter::bezier_fit_cubic_full(), bezier_length_internal(), bezier_length_internal(), bezier_length_internal(), bezier_line_intersections(), SPMeshNodeArray::bicubic(), box3d_half_line_crosses_joining_line(), Inkscape::LivePathEffect::LPEInterpolate::calculate_trajectory(), chord_length_parameterize(), Geom::BezierFitter::chord_length_parameterize(), Inkscape::CanvasItemGuideLine::closest_distance_to(), Inkscape::CanvasItemCtrl::closest_distance_to(), Inkscape::CanvasItemCurve::closest_distance_to(), Geom::BezierFitter::compute_hook(), compute_hook(), Geom::Circle::contains(), Geom::Circle::contains(), control_poly_flat_enough(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), cubic_length_subdividing(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), dist_test(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingGroupConnection::Distance(), distance(), distance(), distance(), distance(), Inkscape::distance_to_segment(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPETransform2Pts::doBeforeEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), Inkscape::UI::Handle::dragged(), Inkscape::LivePathEffect::LPEShowHandles::drawHandleLine(), Inkscape::LivePathEffect::LPESimplify::drawHandleLine(), GrDrag::dropColor(), GrDrag::dropColorOnCorrespondingRegion(), estimate_lengths(), Geom::BezierFitter::estimate_lengths(), Inkscape::UI::PathManipulator::extremeNode(), Inkscape::Extension::Internal::PrintEmf::fill(), Inkscape::Extension::Internal::PrintWmf::fill(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingPoint::FindNearest2(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::FindShortestReconnect(), Geom::Circle::fit(), Inkscape::LivePathEffect::LPESimplify::generateHelperPathAndSmooth(), Inkscape::UI::get_monitor_geometry_at_point(), Inkscape::Extension::Internal::PdfBuilder::Document::get_radial_pattern(), SPStar::getSideLength(), hausdorf(), hausdorfl(), PointHandle::hit(), PointSetHandle::hit(), RectHandle::hit(), Inkscape::LivePathEffect::LPELattice2::horizontal(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::horizontal(), Geom::BezierCurveN< degree >::intersect(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedCurve::intersect(), intersection(), Geom::Circle::intersects(), Inkscape::LivePathEffect::LPERoughen::jitter(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_set(), Geom::BezierCurve::length(), length(), NodeSatellite::lenToRad(), Geom::Path::nearestTime(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingClosest(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), random_arc(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::LivePathEffect::LPETransform2Pts::reset(), Geom::CLIPPER_CLASS::rsplit(), Geom::xAx::set(), Inkscape::UI::Node::setType(), Inkscape::LivePathEffect::LPEOffset::sp_get_offset(), Inkscape::UI::ControlPointSelection::spatialGrow(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST(), Geom::xAx::toCurve(), touching_circle(), Inkscape::UI::Widget::ColorWheelHSLuv::updateGeometry(), SPRect::vectorStretch(), Inkscape::LivePathEffect::LPELattice2::vertical(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::vertical(), wrap_point(), and wrap_rect().

◆ distance() [2/8]

template<typename Curve01T , typename CurveT >
Piecewise< SBasis > Geom::distance ( Curve01T const &  A,
CurveT const &  B,
unsigned int  pieces = 40,
double  adaptive_limit = 1e-5,
double  accuracy = 1e-3 
)
inline

Definition at line 647 of file curve-curve-distance.cpp.

◆ distance() [3/8]

template<typename CurveT >
Piecewise< SBasis > Geom::distance ( Path const &  A,
CurveT const &  B,
unsigned int  pieces = 40,
double  adaptive_limit = 1e-5,
double  accuracy = 1e-3 
)
inline

◆ distance() [4/8]

template<typename CurveT >
Piecewise< SBasis > Geom::distance ( Piecewise< D2< SBasis > > const &  A,
CurveT const &  B,
unsigned int  pieces = 40,
double  adaptive_limit = 1e-5,
double  accuracy = 1e-3 
)
inline

◆ distance() [5/8]

double Geom::distance ( Point const &  _point,
Ray const &  _ray 
)
inline

Definition at line 126 of file ray.h.

References Geom::Ray::nearestTime(), and Geom::Ray::pointAt().

◆ distance() [6/8]

double Geom::distance ( Point const &  p,
LineSegment const &  seg 
)
inline

◆ distance() [7/8]

Coord Geom::distance ( Point const &  p,
OptRect const &  rect 
)

Minimum distance to rectangle, or infinity if empty.

Definition at line 198 of file rect.cpp.

References distance().

◆ distance() [8/8]

Coord Geom::distance ( Point const &  p,
Rect const &  rect 
)
related

◆ distanceSq() [1/2]

Coord Geom::distanceSq ( Point const &  p,
OptRect const &  rect 
)

Minimum square of distance to rectangle, or infinity if empty.

Definition at line 193 of file rect.cpp.

References distanceSq().

◆ distanceSq() [2/2]

◆ divide() [1/9]

Piecewise< SBasis > Geom::divide ( Piecewise< SBasis > const &  a,
Piecewise< SBasis > const &  b,
double  tol,
unsigned  k,
double  zero = 1.e-3 
)

◆ divide() [2/9]

Piecewise< SBasis > Geom::divide ( Piecewise< SBasis > const &  a,
Piecewise< SBasis > const &  b,
unsigned  k 
)

◆ divide() [3/9]

Piecewise< SBasis > Geom::divide ( Piecewise< SBasis > const &  a,
SBasis const &  b,
double  tol,
unsigned  k,
double  zero = 1.e-3 
)

Definition at line 60 of file piecewise.cpp.

References divide().

◆ divide() [4/9]

Poly Geom::divide ( Poly const &  a,
Poly const &  b,
Poly r 
)

◆ divide() [5/9]

Piecewise< SBasis > Geom::divide ( SBasis const &  a,
Piecewise< SBasis > const &  b,
double  tol,
unsigned  k,
double  zero = 1.e-3 
)

Definition at line 63 of file piecewise.cpp.

References divide().

◆ divide() [6/9]

Piecewise< SBasis > Geom::divide ( SBasis const &  a,
SBasis const &  b,
double  tol,
unsigned  k,
double  zero = 1.e-3 
)

◆ divide() [7/9]

SBasis Geom::divide ( SBasis const &  a,
SBasis const &  b,
int  k 
)

Compute a / b to k terms.

Parameters
a,bsbasis functions
Returns
sbasis a/b

It is recommended to use the piecewise version unless you have good reason.

Definition at line 421 of file sbasis.cpp.

References c, Geom::SBasis::isZero(), multiply(), Geom::SBasis::resize(), shift(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().

◆ divide() [8/9]

SBasis2d Geom::divide ( SBasis2d const &  a,
SBasis2d const &  b,
int  k 
)

◆ divide() [9/9]

template<unsigned n>
SBasisN< n > Geom::divide ( SBasisN< n > const &  a,
SBasisN< n > const &  b,
int  k 
)

◆ divide_out_root()

Poly Geom::divide_out_root ( Poly const &  p,
double  x 
)

◆ dot() [1/3]

template<typename T >
T Geom::dot ( D2< T > const &  a,
D2< T > const &  b 
)
inline

Definition at line 355 of file d2.h.

Referenced by Inkscape::CanvasItemGridXY::_render(), all_nearest_times(), ang(), Geom::Point::angle_between(), Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Geom::Line::are_orthogonal(), Geom::Piecewise< T >::centroid(), Geom::RatQuad::circularArc(), cubic_length_subdividing(), Geom::Piecewise< T >::curvature(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), distance(), Geom::detail::bezier_clipping::distance_control_points(), distanceLessThanOrEqual(), DistanceToCubic(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), Geom::Piecewise< T >::dot(), Geom::Piecewise< T >::dot(), estimate_lengths(), Geom::BezierFitter::estimate_lengths(), extremePoints(), fill_line_in_rect(), find_ellipse(), Geom::D2< T >::find_normals(), Geom::D2< T >::find_normals_by_vector(), Geom::D2< T >::find_tangents_by_vector(), Geom::xAx::fromPoint(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::genSteinerEllipse(), goal_function(), Geom::BezierCurveN< degree >::intersect(), Box3D::Line::intersect(), intersect(), intersect_polish_root(), intersect_polish_root(), intersection(), Geom::detail::intersection_impl(), intersector_ccw(), Geom::Parallelogram::isSheared(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), L2(), Box3D::Line::lambda(), Geom::D2< T >::length_integrating(), lensq(), Geom::BezierFitter::lensq(), Box3D::Line::lie_on_same_side(), Box3D::lies_in_sector(), Box3D::Line::Line(), line_best_fit(), line_intersection(), line_segment_intersect(), line_twopoint_intersect(), md_sample_based(), Geom::ConvexHull::minAreaRotation(), Inkscape::UI::Handle::move(), nearest_time(), Geom::BezierCurveN< degree >::nearestTime(), Geom::Ray::nearestTime(), Geom::BezierFitter::NewtonRaphsonRootFind(), NewtonRaphsonRootFind(), Geom::Line::normalAndDist(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), RecDistanceToCubic(), rect_line_intersect(), Inkscape::SelTrans::rotateRequest(), segment_intersect(), Box3D::Line::set_direction(), Inkscape::PureRotateConstrained::storeTransform(), tighten(), tighten(), Geom::Line::timeAtProjection(), touching_circle(), Geom::xAx::translate(), triangulate(), and Geom::Piecewise< T >::unitVector().

◆ dot() [2/3]

Piecewise< SBasis > Geom::dot ( Piecewise< D2< SBasis > > const &  a,
Piecewise< D2< SBasis > > const &  b 
)
related

◆ dot() [3/3]

Piecewise< SBasis > Geom::dot ( Piecewise< D2< SBasis > > const &  a,
Point const &  b 
)
related

◆ double_axis_intersections()

static std::vector< ShapeIntersection > Geom::double_axis_intersections ( std::vector< ShapeIntersection > &&  axis_intersections,
bool  vertical 
)
static

For each intersection of some shape with the major axis of an ellipse, produce one or two intersections of a degenerate ellipse (collapsed onto that axis) with the same shape.

Parameters
axis_intersectionsThe intersections of some shape with the major axis.
verticalWhether this is the vertical major axis (in the ellipse's natural coordinates).
Returns
A vector with doubled intersections (corresponding to the two passages of the squashed ellipse through that point) and swapped order of the intersected shapes.

Definition at line 440 of file ellipse.cpp.

References axis_time_to_angles(), and result.

Referenced by Geom::Ellipse::intersect(), and Geom::Ellipse::intersect().

◆ eliminate_duplicates_p()

static void Geom::eliminate_duplicates_p ( std::vector< Point > &  pts)
static

Definition at line 238 of file geom.cpp.

References is_less(), and size.

Referenced by rect_line_intersect().

◆ elliptic_quadratic_form()

Affine Geom::elliptic_quadratic_form ( Affine const &  m)
related

◆ EpsilonBy()

static double Geom::EpsilonBy ( double  value,
int  eps 
)
static

Definition at line 263 of file basic-intersection.cpp.

Referenced by intersect_polish_root().

◆ EpsilonOf()

static double Geom::EpsilonOf ( double  value)
static

Definition at line 116 of file path-intersection.cpp.

◆ equality_test()

template<typename IntervalType , typename OptIntervalType >
constexpr bool Geom::equality_test ( )
constexpr

Definition at line 24 of file interval-test.cpp.

References X, and Y.

◆ estimate_bi()

static void Geom::estimate_bi ( Point  b[4],
unsigned  ei,
Point const  data[],
double const  u[],
unsigned  len 
)
static

Definition at line 492 of file bezier-utils.cpp.

References data, len, and num.

Referenced by generate_bezier().

◆ estimate_lengths()

static void Geom::estimate_lengths ( Point  bezier[],
Point const  data[],
double const  u[],
unsigned  len,
Point const &  tHat1,
Point const &  tHat2 
)
static
Todo:
Check whether this special-casing is necessary now that NewtonRaphsonRootFind handles non-positive denominator.
Todo:
Check whether this special-casing is necessary now that NewtonRaphsonRootFind handles non-positive denominator.

Definition at line 387 of file bezier-utils.cpp.

References data, distance(), dot(), len, and X.

Referenced by generate_bezier().

◆ extract_u() [1/2]

Linear Geom::extract_u ( Linear2d const &  a,
double  u 
)
inline

Definition at line 90 of file sbasis-2d.h.

Referenced by cairo_d2_sb2d(), cairo_sb2d(), and extract_u().

◆ extract_u() [2/2]

SBasis Geom::extract_u ( SBasis2d const &  a,
double  u 
)

◆ extract_v() [1/2]

Linear Geom::extract_v ( Linear2d const &  a,
double  v 
)
inline

Definition at line 96 of file sbasis-2d.h.

Referenced by cairo_d2_sb2d(), cairo_sb2d(), and extract_v().

◆ extract_v() [2/2]

SBasis Geom::extract_v ( SBasis2d const &  a,
double  v 
)

◆ f_interp()

double Geom::f_interp ( double  x,
void *  p 
)

Definition at line 82 of file chebyshev.cpp.

Referenced by chebyshev_approximant_interpolating().

◆ fake_cull()

std::vector< std::vector< unsigned > > Geom::fake_cull ( unsigned  a,
unsigned  b 
)

Definition at line 130 of file sweep-bounds.cpp.

◆ filter_line_segment_intersections()

void Geom::filter_line_segment_intersections ( std::vector< ShapeIntersection > &  xs,
bool  a = false,
bool  b = true 
)

Removes intersections outside of the unit interval.

A helper used to implement line segment intersections.

Parameters
xsLine intersections
aWhether the first time value has to be in the unit interval
bWhether the second time value has to be in the unit interval
Returns
Appropriately filtered intersections

Definition at line 287 of file line.cpp.

References Geom::GenericInterval< C >::contains().

Referenced by Geom::Line::intersect(), and Geom::Circle::intersect().

◆ filter_ray_intersections()

void Geom::filter_ray_intersections ( std::vector< ShapeIntersection > &  xs,
bool  a = false,
bool  b = true 
)

Definition at line 300 of file line.cpp.

Referenced by Geom::Line::intersect().

◆ find_bernstein_roots() [1/2]

void Geom::find_bernstein_roots ( double const *  w,
unsigned  degree,
std::vector< double > &  solutions,
unsigned  depth,
double  left_t = 0,
double  right_t = 1,
bool  use_secant = true 
)

Definition at line 45 of file solve-bezier-one-d.cpp.

References degree, solutions, and w.

Referenced by Geom::Bezier::roots().

◆ find_bernstein_roots() [2/2]

void Geom::find_bernstein_roots ( std::vector< double > &  solutions,
Geom::Bezier const &  bz,
double  left_t,
double  right_t 
)

Definition at line 56 of file solve-bezier-one-d.cpp.

References Geom::Bezier::degree(), solutions, and w.

◆ find_bottom_right()

unsigned Geom::find_bottom_right ( ConvexHull const &  a)

Definition at line 593 of file convex-hull.cpp.

References Geom::ConvexHull::size(), and Y.

◆ find_collinear_normal()

void Geom::find_collinear_normal ( std::vector< std::pair< double, double > > &  xs,
std::vector< Point > const &  A,
std::vector< Point > const &  B,
double  precision = EPSILON 
)

Definition at line 1128 of file bezier-clipping.cpp.

Referenced by hausdorfl().

◆ find_direction_of_travel()

static float Geom::find_direction_of_travel ( Path const &  path,
PathTime const &  time,
Dim2  d 
)
static

Determine whether the d-coordinate increases or decreases at the given path time.

Parameters
pathA path.
timeA forward-normalized time on the given path.
dThe coordinate about which we want to know whether it increases.
Returns
+1.0 if the coordinate increases, -1.0 if it decreases, 0.0 if it remains constant.

Definition at line 59 of file path-extrema.cpp.

References Geom::Path::closed(), Geom::PathTime::curve_index, Geom::Path::curveAt(), Geom::Path::finalUnitTangent(), Geom::Path::initialUnitTangent(), sign(), Geom::Path::size(), Geom::PathTime::t, and Geom::Curve::unitTangentAt().

Referenced by Geom::Path::extrema().

◆ find_ellipse()

static Ellipse Geom::find_ellipse ( Point  P,
Point  Q,
Point  O 
)
static

document this! very quick: this finds the ellipse with minimum eccentricity passing through point P and Q, with tangent PO at P and QO at Q http://mathforum.org/kb/message.jspa?messageID=7471596&tstart=0

Definition at line 63 of file lpe-powerstroke.cpp.

References c, cross(), D, dot(), K, X, and Y.

Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().

◆ find_intersections() [1/3]

void Geom::find_intersections ( std::vector< std::pair< double, double > > &  xs,
D2< Bezier > const &  A,
D2< Bezier > const &  B,
double  precision = EPSILON 
)

◆ find_intersections() [2/3]

void Geom::find_intersections ( std::vector< std::pair< double, double > > &  xs,
D2< SBasis > const &  A,
D2< SBasis > const &  B,
double  precision = EPSILON 
)

◆ find_intersections() [3/3]

void Geom::find_intersections ( std::vector< std::pair< double, double > > &  xs,
std::vector< Point > const &  A,
std::vector< Point > const &  B,
double  precision = EPSILON 
)

Definition at line 95 of file basic-intersection.cpp.

References find_intersections_bezier_clipping().

◆ find_intersections_bezier_clipping()

void Geom::find_intersections_bezier_clipping ( std::vector< std::pair< double, double > > &  xs,
std::vector< Point > const &  A,
std::vector< Point > const &  B,
double  precision = EPSILON 
)

◆ find_intersections_bezier_recursive() [1/2]

void Geom::find_intersections_bezier_recursive ( std::vector< std::pair< double, double > > &  xs,
OldBezier  a,
OldBezier  b 
)
static

◆ find_intersections_bezier_recursive() [2/2]

void Geom::find_intersections_bezier_recursive ( std::vector< std::pair< double, double > > &  xs,
vector< Geom::Point > const &  A,
vector< Geom::Point > const &  B,
double   
)

◆ find_normals()

std::vector< double > Geom::find_normals ( Point  P,
D2< SBasis > const &  A 
)
related

◆ find_normals_by_vector()

std::vector< double > Geom::find_normals_by_vector ( Point  V,
D2< SBasis > const &  A 
)
related

◆ find_parametric_bezier_roots()

void Geom::find_parametric_bezier_roots ( Geom::Point const *  w,
unsigned  degree,
std::vector< double > &  solutions,
unsigned  depth 
)

◆ find_self_intersections() [1/2]

void Geom::find_self_intersections ( std::vector< std::pair< double, double > > &  xs,
D2< Bezier > const &  A,
double  precision = EPSILON 
)

◆ find_self_intersections() [2/2]

void Geom::find_self_intersections ( std::vector< std::pair< double, double > > &  xs,
D2< SBasis > const &  A,
double  precision = EPSILON 
)

◆ find_tangents()

std::vector< double > Geom::find_tangents ( Point  P,
D2< SBasis > const &  A 
)
related

◆ find_tangents_by_vector()

std::vector< double > Geom::find_tangents_by_vector ( Point  V,
D2< SBasis > const &  A 
)
related

◆ flip_crossings()

void Geom::flip_crossings ( Crossings crs)

Definition at line 687 of file path-intersection.cpp.

Referenced by crossings_among().

◆ force_continuity()

◆ format_coord_nice()

◆ format_coord_shortest()

std::string Geom::format_coord_shortest ( Coord  x)

Definition at line 77 of file coord.cpp.

References builder.

Referenced by Geom::SVGPathWriter::_formatCoord(), and TEST().

◆ from_basis()

Affine Geom::from_basis ( Point const &  x_basis,
Point const &  y_basis,
Point const &  offset 
)

Creates a Affine given an axis and origin point.

The axis is represented as two vectors, which represent skew, rotation, and scaling in two dimensions. from_basis(Point(1, 0), Point(0, 1), Point(0, 0)) would return the identity matrix.

Parameters
x_basisthe vector for the x-axis.
y_basisthe vector for the y-axis.
offsetthe translation applied by the matrix.
Returns
The new Affine.

Definition at line 26 of file affine.cpp.

References offset, X, and Y.

Referenced by Inkscape::LivePathEffect::findShadowedTime().

◆ fuse_nearby_ends()

◆ gcd()

Poly Geom::gcd ( Poly const &  a,
Poly const &  b,
const double  tol = 1e-10 
)

Definition at line 214 of file polynomial.cpp.

References divide(), and gcd().

Referenced by gcd().

◆ generate_bezier()

static void Geom::generate_bezier ( Point  bezier[],
Point const  data[],
double const  u[],
unsigned const  len,
Point const &  tHat1,
Point const &  tHat2,
double const  tolerance_sq 
)
static

Fill in bezier[] based on the given data and tangent requirements, using a least-squares fit.

Each of tHat1 and tHat2 should be either a zero vector or a unit vector. If it is zero, then bezier[1 or 2] is estimated without constraint; otherwise, it bezier[1 or 2] is placed in the specified direction from bezier[0 or 3].

Parameters
tolerance_sqUsed only for an initial guess as to tangent directions when tHat1 or tHat2 is zero.

Definition at line 360 of file bezier-utils.cpp.

References darray_left_tangent(), darray_right_tangent(), data, estimate_bi(), estimate_lengths(), is_zero(), len, and unit_vector().

Referenced by bezier_fit_cubic_full().

◆ get_nodetype()

◆ graham_merge()

ConvexHull Geom::graham_merge ( ConvexHull  a,
ConvexHull  b 
)

if we modified graham scan to work top to bottom as proposed in lect754.pdf we could replace the angle sort with a simple merge sort type algorithm. furthermore, we could do the graham scan online, avoiding a bunch of memory copies. That would probably be linear. – njh

Definition at line 687 of file convex-hull.cpp.

References Geom::ConvexHull::begin(), Geom::ConvexHull::end(), and result.

◆ handles_to_sbasis()

template<typename T >
D2< SBasis > Geom::handles_to_sbasis ( T const &  handles,
unsigned  order 
)
inline

Definition at line 56 of file bezier-to-sbasis.h.

References bezier_to_sbasis(), and order.

◆ hausdorf()

double Geom::hausdorf ( D2< SBasis > &  A,
D2< SBasis > const &  B,
double  m_precision,
double *  a_t = NULL,
double *  b_t = NULL 
)

Compute the symmetric Hausdorf distance.

Definition at line 451 of file basic-intersection.cpp.

References Geom::D2< T >::at0(), Geom::D2< T >::at1(), distance(), hausdorfl(), and nearest_time().

◆ hausdorfl()

double Geom::hausdorfl ( D2< SBasis > &  A,
D2< SBasis > const &  B,
double  m_precision,
double *  a_t = NULL,
double *  b_t = NULL 
)

Compute the Hausdorf distance from A to B only.

Definition at line 401 of file basic-intersection.cpp.

References Geom::D2< T >::at0(), Geom::D2< T >::at1(), distance(), find_collinear_normal(), nearest_time(), and sbasis_to_bezier().

Referenced by hausdorf().

◆ identity()

Affine Geom::identity ( )
related

Create an identity matrix.

This is a convenience function identical to Affine::identity().

Definition at line 210 of file affine.h.

References Geom::Affine::identity().

Referenced by Inkscape::ObjectSnapper::_collectPaths(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::Extension::Internal::SvgBuilder::_getClip(), BlurKnotHolderEntity::_pos(), Inkscape::CanvasItemRect::_render(), Inkscape::Extension::Internal::SvgBuilder::_shouldClip(), _ungroup_compensate_source_transform(), SPSymbol::bbox(), SPRoot::build(), Inkscape::ObjectSet::clearLastAffine(), ClipHistoryEntry::ClipHistoryEntry(), Inkscape::UI::Dialog::LivePathEffectEditor::clonetolpeitem(), Inkscape::AlignmentSnapper::constrainedSnap(), Inkscape::DistributionSnapper::constrainedSnap(), Inkscape::ObjectSnapper::constrainedSnap(), Inkscape::Pixbuf::create_from_buffer(), Inkscape::Pixbuf::create_from_data_uri(), Inkscape::Extension::Internal::SvgBuilder::cropPage(), ctmToAffine(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPECopyRotate::doAfterEffect(), Inkscape::LivePathEffect::LPETiling::doBeforeEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path_post(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), Inkscape::LivePathEffect::LPECloneOriginal::doOnRemove(), Inkscape::LivePathEffect::LPETiling::doOnVisibilityToggled(), SPItem::doWriteTransform(), feed_path_to_cairo(), Inkscape::AlignmentSnapper::freeSnap(), Inkscape::DistributionSnapper::freeSnap(), Inkscape::ObjectSnapper::freeSnap(), generate_marker(), SPFilter::get_automatic_filter_region(), Inkscape::Pixbuf::get_embedded_orientation(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), Inkscape::Filters::FilterUnits::get_matrix_user2units(), SPUse::get_parent_transform(), SPViewBox::get_rctx(), Inkscape::LivePathEffect::PathParam::get_relative_affine(), SPUse::get_root_transform(), Inkscape::UI::Dialog::CloneTiler::get_transform(), SPGradient::getAllItemsBox(), SPItem::getClipPathVector(), Inkscape::PageManager::getSelectedPageAffine(), Inkscape::ObjectSet::group(), i2i_affine(), Inkscape::Extension::Internal::PdfBuilder::Document::item_to_transparency_group(), Inkscape::Extension::Internal::LaTeXTextRenderer::LaTeXTextRenderer(), Inkscape::LivePathEffect::SatelliteParam::linked_modified(), Inkscape::LivePathEffect::LPEBool::LPEBool(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_group(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item_group(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item_to_raster(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_raster(), path_simplify(), Inkscape::UI::PathManipulator::PathManipulator(), SPPattern::produce(), Inkscape::SelTrans::scaleRequest(), SPGradient::set(), SPItem::set(), SPPattern::set(), SPHatch::set(), SPBox3D::set_transform(), SPLine::set_transform(), SPPath::set_transform(), Inkscape::DrawingGroup::setChildTransform(), ClipHistoryEntry::setClip(), Inkscape::ObjectSet::setClipGroup(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::UI::Widget::RegisteredTransformedPoint::setTransform(), Inkscape::DrawingItem::setTransform(), SPDocument::setupViewport(), Inkscape::BooleanBuilder::shape_commit(), Inkscape::SelTrans::skewRequest(), Inkscape::LivePathEffect::sp_bbox_without_clip(), sp_gradient_convert_to_userspace(), sp_image_set_curve(), sp_item_group_ungroup(), sp_item_transform_repr(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), sp_svg_transform_read(), Inkscape::Extension::Internal::sp_symbol_render(), Inkscape::UI::Toolbar::ConnectorToolbar::spacing_changed(), SPGradient::SPGradient(), SPItem::SPItem(), Inkscape::LivePathEffect::LPESlice::splititem(), Inkscape::SelTrans::stamp(), Inkscape::SelTrans::stretchRequest(), Inkscape::Extension::Internal::PdfBuilder::Document::style_to_transparency_mask(), TEST(), Inkscape::ObjectSet::toSymbol(), Inkscape::DrawingItem::transform(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::transform(), SPUse::unlink(), SPMarker::update(), SPClipPath::update_view(), and SPMask::update_view().

◆ idx_to_pair()

template<typename T >
T Geom::idx_to_pair ( pair< T, T >  p,
int  idx 
)

Definition at line 646 of file convex-hull.cpp.

Referenced by merge().

◆ inc()

template<typename iter >
iter Geom::inc ( iter const &  x,
unsigned  n 
)

◆ integral() [1/7]

◆ integral() [2/7]

template<typename T >
D2< T > Geom::integral ( D2< T > const &  a)

Definition at line 456 of file d2.h.

References integral(), X, and Y.

◆ integral() [3/7]

Poly Geom::integral ( Poly const &  p)

Definition at line 133 of file polynomial.cpp.

References result.

◆ integral() [4/7]

SBasis Geom::integral ( SBasis const &  c)

Compute the integral of a (Exact)

Parameters
asbasis functions
Returns
sbasis integral(a)

Definition at line 299 of file sbasis.cpp.

References c, Geom::SBasis::normalize(), and Geom::SBasis::resize().

◆ integral() [5/7]

SBasis2d Geom::integral ( SBasis2d const &  c)

◆ integral() [6/7]

template<unsigned n>
SBasisN< n > Geom::integral ( SBasisN< n > const &  c)

◆ integral() [7/7]

template<typename T >
SBasisOf< T > Geom::integral ( SBasisOf< T > const &  c)

Definition at line 493 of file sbasis-of.h.

References c, Geom::HatOf< T >::d, and Geom::SBasisOf< T >::normalize().

◆ interpolate()

Piecewise< SBasis > Geom::interpolate ( std::vector< double >  times,
std::vector< double >  values,
unsigned  smoothness 
)

Returns a Piecewise SBasis with prescribed values at prescribed times.

Parameters
timesvector of times at which the values are given. Should be sorted in increasing order.
valuesvector of prescribed values. Should have the same size as times and be sorted accordingly.
smoothness(defaults to 1) regularity class of the result: 0=piecewise linear, 1=continuous derivative, etc...

Definition at line 349 of file sbasis-math.cpp.

References Geom::SBasis::at0(), Geom::SBasis::at1(), Geom::Piecewise< T >::cuts, integral(), result, reverse(), and shift().

◆ intersect() [1/8]

◆ intersect() [2/8]

OptInterval Geom::intersect ( Interval const &  a,
Interval const &  b 
)
inline

Definition at line 220 of file interval.h.

◆ intersect() [3/8]

OptIntRect Geom::intersect ( IntRect const &  a,
IntRect const &  b 
)
inline

Definition at line 49 of file int-rect.h.

◆ intersect() [4/8]

OptIntRect Geom::intersect ( OptIntRect const &  a,
OptIntRect const &  b 
)
inline

Definition at line 52 of file int-rect.h.

◆ intersect() [5/8]

OptRect Geom::intersect ( OptRect const &  a,
OptRect const &  b 
)
inline

Definition at line 253 of file rect.h.

◆ intersect() [6/8]

OptRect Geom::intersect ( Rect const &  a,
Rect const &  b 
)
inline

Definition at line 250 of file rect.h.

◆ intersect() [7/8]

static std::vector< Interval > Geom::intersect ( std::vector< Interval > const &  a,
std::vector< Interval > const &  b 
)
static

Definition at line 303 of file d2-sbasis.cpp.

References c, and result.

◆ intersect() [8/8]

static std::vector< Interval > Geom::intersect ( std::vector< Interval > const &  a,
std::vector< Interval > const &  b 
)
static

Definition at line 149 of file intersection-by-smashing.cpp.

References c, and result.

◆ intersect_BB()

bool Geom::intersect_BB ( OldBezier  a,
OldBezier  b 
)

◆ intersect_polish_f() [1/2]

static int Geom::intersect_polish_f ( const gsl_vector *  x,
void *  params,
gsl_vector *  f 
)
static

Definition at line 242 of file basic-intersection.cpp.

Referenced by intersect_polish_root(), and intersect_polish_root().

◆ intersect_polish_f() [2/2]

static int Geom::intersect_polish_f ( const gsl_vector *  x,
void *  params,
gsl_vector *  f 
)
static

Definition at line 139 of file path-intersection.cpp.

◆ intersect_polish_root() [1/2]

static void Geom::intersect_polish_root ( Curve const &  A,
double &  s,
Curve const &  B,
double &  t 
)
static

we want to solve J*(x1 - x0) = f(x0)

|dA(s)[0] -dB(t)[0]| (X1 - X0) = A(s) - B(t) |dA(s)[1] -dB(t)[1]|

Definition at line 156 of file path-intersection.cpp.

References bs, dot(), intersect_polish_f(), Geom::Affine::inverse(), and Geom::Curve::pointAndDerivatives().

◆ intersect_polish_root() [2/2]

static void Geom::intersect_polish_root ( D2< SBasis > const &  A,
double &  s,
D2< SBasis > const &  B,
double &  t 
)
static

we want to solve J*(x1 - x0) = f(x0)

|dA(s)[0] -dB(t)[0]| (X1 - X0) = A(s) - B(t) |dA(s)[1] -dB(t)[1]|

Definition at line 272 of file basic-intersection.cpp.

References bs, c, dot(), EpsilonBy(), intersect_polish_f(), Geom::Affine::inverse(), L1(), and Geom::D2< T >::valueAndDerivatives().

Referenced by mono_intersect(), pair_intersect(), and polish_intersections().

◆ intersection() [1/11]

ConvexHull Geom::intersection ( ConvexHull  ,
ConvexHull   
)

Definition at line 632 of file convex-hull.cpp.

◆ intersection() [2/11]

OptCrossing Geom::intersection ( Line const &  l1,
Line const &  l2 
)

◆ intersection() [3/11]

OptCrossing Geom::intersection ( Line const &  l1,
LineSegment const &  ls2 
)
inline

Definition at line 564 of file line.h.

References Geom::detail::intersection_impl().

◆ intersection() [4/11]

OptCrossing Geom::intersection ( Line const &  l1,
Ray const &  r2 
)
inline

Definition at line 552 of file line.h.

References Geom::detail::intersection_impl().

◆ intersection() [5/11]

LineSegment Geom::intersection ( Line  l,
Rect  r 
)

Definition at line 47 of file conicsec.cpp.

References Geom::Line::clip().

◆ intersection() [6/11]

OptCrossing Geom::intersection ( LineSegment const &  ls1,
Line const &  l2 
)
inline

Definition at line 558 of file line.h.

References Geom::detail::intersection_impl().

◆ intersection() [7/11]

OptCrossing Geom::intersection ( LineSegment const &  ls1,
LineSegment const &  ls2 
)

◆ intersection() [8/11]

OptCrossing Geom::intersection ( LineSegment const &  ls1,
Ray const &  r2 
)
inline

Definition at line 570 of file line.h.

References Geom::detail::intersection_impl().

◆ intersection() [9/11]

◆ intersection() [10/11]

OptCrossing Geom::intersection ( Ray const &  r1,
LineSegment const &  ls2 
)
inline

Definition at line 577 of file line.h.

References Geom::detail::intersection_impl().

◆ intersection() [11/11]

OptCrossing Geom::intersection ( Ray const &  r1,
Ray const &  r2 
)

◆ intersection_point() [1/2]

static std::optional< Point > Geom::intersection_point ( Point const &  origin_a,
Point const &  vector_a,
Point const &  origin_b,
Point const &  vector_b 
)
static

Find the point where two straight lines cross.

Definition at line 39 of file lpe-powerstroke.cpp.

References are_near(), and cross().

◆ intersection_point() [2/2]

static Point Geom::intersection_point ( Point  origin_a,
Point  vector_a,
Point  origin_b,
Point  vector_b 
)
static

◆ intersector_ccw()

int Geom::intersector_ccw ( const Geom::Point p0,
const Geom::Point p1,
const Geom::Point p2 
)

Definition at line 96 of file geom.cpp.

References c, dot(), and rot90().

Referenced by line_segment_intersectp().

◆ inverse() [1/3]

SBasis Geom::inverse ( SBasis  a,
int  k 
)

find the function a^-1 such that a^-1 composed with a to k terms is the identity function

Parameters
asbasis function
Returns
sbasis a^-1 s.t. a^-1(a(t)) = 1

The function must have 'unit range'("a00 = 0 and a01 = 1") and be monotonic.

Definition at line 505 of file sbasis.cpp.

References c, multiply(), Geom::SBasis::resize(), Geom::SBasis::size(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().

◆ inverse() [2/3]

SBasis2d Geom::inverse ( SBasis2d const &  a,
int  k 
)

◆ inverse() [3/3]

◆ is_clockwise_turn()

static bool Geom::is_clockwise_turn ( Point const &  a,
Point const &  b,
Point const &  c 
)
static

Definition at line 107 of file convex-hull.cpp.

References c, and cross().

Referenced by Geom::ConvexHull::_construct().

◆ is_digit()

static bool Geom::is_digit ( char  c)
inlinestatic

Definition at line 41 of file svg-path-writer.cpp.

References c.

Referenced by Geom::SVGPathWriter::flush().

◆ is_less()

static bool Geom::is_less ( Point const &  A,
Point const &  B 
)
static

Definition at line 225 of file geom.cpp.

References X, and Y.

Referenced by eliminate_duplicates_p().

◆ is_unit_vector()

bool Geom::is_unit_vector ( Point const &  p,
Coord  eps = EPSILON 
)
related

Referenced by wrap_point().

◆ is_zero()

◆ L1()

◆ L2() [1/2]

double Geom::L2 ( D2< double > const &  a)

◆ L2() [2/2]

SBasis Geom::L2 ( D2< SBasis > const &  a,
unsigned  k 
)

Definition at line 42 of file d2-sbasis.cpp.

References dot(), and sqrt().

Referenced by Inkscape::UI::Tools::EraserTool::_addCap(), Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Tools::EraserTool::_brush(), Inkscape::LivePathEffect::_circle3(), Inkscape::SelTrans::_keepClosestPointOnly(), Inkscape::UI::Tools::PenTool::_setAngleDistanceStatusMessage(), Inkscape::AlignmentSnapper::_snapBBoxPoints(), Inkscape::ObjectSnapper::_snapNodes(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::ObjectSnapper::_snapTranslatingGuide(), Geom::EllipticalArc::_updateCenterAndAngles(), Inkscape::UI::Tools::TextTool::_updateCursor(), Inkscape::UI::Tools::add_cap(), GrDrag::addDragger(), Box3D::VPDrag::addDragger(), GrDrag::addStopNearPoint(), Inkscape::UI::Tools::CalligraphicTool::apply(), arc_length_deriv(), box3d_snap(), cartesian_to_polar(), Geom::Point::constrain_angle(), Inkscape::LineSnapper::constrainedSnap(), Path::ConvertEvenLines(), curvature(), Path::CurvilignToPosition(), Path::DashSubPath(), dist_to(), distanceLessThanOrEqual(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPESimplify::doEffect(), Inkscape::LivePathEffect::LPECircleWithRadius::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::StarTool::drag(), draw_ratquad(), eat(), Inkscape::LineSnapper::freeSnap(), fuse_nearby_ends(), get_nodetype(), getClosestSP(), Inkscape::SnappedPoint::getDistanceToAlignTarget(), gr_knot_moved_handler(), gr_knot_moved_midpoint_handler(), Inkscape::UI::TransformHandle::grabbed(), Inkscape::LivePathEffect::LPEKnotNS::idx_of_nearest(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedLine::intersect(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedLineSegment::intersect(), Geom::Point::is_unit_vector(), Inkscape::SnappedPoint::isOtherSnapBetter(), Inkscape::ObjectSnapper::isUnselectedNode(), item_find_paths(), Box3D::Line::lambda(), Path::Length(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), Shape::MakeOffset(), Shape::MakeTweak(), Inkscape::Rubberband::move(), SnapManager::multipleConstrainedSnaps(), nearest_after(), neighbors(), Inkscape::UI::Dialog::SpellCheck::nextWord(), Inkscape::UI::Widget::Rotateable::on_motion(), Geom::Ellipse::operator*=(), Path::PositionToLength(), Inkscape::Snapper::SnapConstraint::projection(), Box3D::Line::pts_coincide(), Inkscape::LivePathEffect::LPERoughHatches::resetDefaults(), Inkscape::Selection::rotateAnchored(), Inkscape::SelTrans::rotateRequest(), GrDrag::selectByCoords(), Geom::xAx::set(), Geom::xAx::set(), Proj::TransfMat3x4::set_infinite_direction(), Inkscape::PureRotateConstrained::snap(), Inkscape::PureTransform::snap(), Inkscape::UI::Tools::ToolBase::snap_delay_handler(), sort_nearest_bis(), sp_item_gradient_set_coords(), sp_star_get_curvepoint(), Inkscape::UI::Tools::sp_tweak_color_recursive(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), split_at_discontinuities(), Inkscape::PureScale::storeTransform(), Inkscape::PureRotateConstrained::storeTransform(), Inkscape::UI::Tools::tweak_colors_in_gradient(), and Box3D::vp_knot_moved_handler().

◆ length() [1/3]

double Geom::length ( D2< SBasis > const &  M,
double  tol = .01 
)
related

Definition at line 344 of file sbasis-geometric.cpp.

References arcLengthSb(), and length().

◆ length() [2/3]

◆ length() [3/3]

double Geom::length ( Piecewise< D2< SBasis > > const &  M,
double  tol = .01 
)
related

Definition at line 350 of file sbasis-geometric.cpp.

References arcLengthSb(), and length().

◆ length_integrating()

void Geom::length_integrating ( D2< SBasis > const &  B,
double &  result,
double &  abs_error,
double  tol 
)
related

◆ lensq()

static double Geom::lensq ( Point const  p)
static

Definition at line 487 of file bezier-utils.cpp.

References dot().

Referenced by compute_max_error_ratio(), and NewtonRaphsonRootFind().

◆ lerp()

template<typename T >
T Geom::lerp ( double  t,
a,
b 
)
inline

Definition at line 43 of file linear-of.h.

◆ lerpppp()

double Geom::lerpppp ( double  t,
double  a,
double  b 
)
inline

Definition at line 47 of file linearN.h.

Referenced by Geom::LinearN< n >::valueAt().

◆ level_set() [1/6]

std::vector< Interval > Geom::level_set ( D2< SBasis > const &  f,
Point  p,
double  tol 
)

Definition at line 322 of file d2-sbasis.cpp.

References Geom::GenericRect< C >::expandBy(), and level_set().

◆ level_set() [2/6]

std::vector< Interval > Geom::level_set ( D2< SBasis > const &  f,
Rect  region 
)

◆ level_set() [3/6]

std::vector< Interval > Geom::level_set ( Piecewise< SBasis > const &  f,
double  v,
double  vtol,
double  tol = 1e-5 
)

Definition at line 250 of file piecewise.cpp.

References level_set().

◆ level_set() [4/6]

std::vector< Interval > Geom::level_set ( Piecewise< SBasis > const &  f,
Interval const &  level,
double  tol = 1e-5 
)

◆ level_set() [5/6]

std::vector< Interval > Geom::level_set ( SBasis const &  f,
double  level,
double  vtol = 1e-5,
double  a = 0.,
double  b = 1.,
double  tol = 1e-5 
)

Solve f(t) = v +/- tolerance.

The collection of intervals where v - vtol <= f(t) <= v+vtol is returned (with a precision tol on the boundaries).

Parameters
fsbasis function
levelthe value of v.
vtolerror tolerance on v.
a,blimit search on domain [a,b]
toltolerance on the result bounds.
Returns
a vector of intervals.

◆ level_set() [6/6]

std::vector< Interval > Geom::level_set ( SBasis const &  f,
Interval const &  level,
double  a = 0.,
double  b = 1.,
double  tol = 1e-5 
)

Solve f(t)\in I=[u,v], which defines a collection of intervals (J_k).

More precisely, a collection (J'_k) is returned with J'_k = J_k up to a given tolerance.

Parameters
fsbasis function
levelthe given interval of deisred values for f.
a,blimit search on domain [a,b]
toltolerance on the bounds of the result.
Returns
a vector of intervals.

◆ level_sets() [1/4]

std::vector< std::vector< Interval > > Geom::level_sets ( D2< SBasis > const &  f,
std::vector< Point pts,
double  tol 
)

Definition at line 342 of file d2-sbasis.cpp.

References level_sets().

◆ level_sets() [2/4]

std::vector< std::vector< Interval > > Geom::level_sets ( D2< SBasis > const &  f,
std::vector< Rect regions 
)

Definition at line 327 of file d2-sbasis.cpp.

References intersect(), level_sets(), result, X, and Y.

Referenced by level_set(), level_sets(), and level_sets().

◆ level_sets() [3/4]

std::vector< std::vector< Interval > > Geom::level_sets ( SBasis const &  f,
std::vector< double > const &  levels,
double  a = 0.,
double  b = 1.,
double  vtol = 1e-5,
double  tol = 1e-5 
)

'Solve' f(t) = v +/- tolerance for several values of v at once.

Parameters
fsbasis function
levelsvector of values, that should be sorted.
vtolerror tolerance on v.
a,blimit search on domain [a,b]
tolthe bounds of the returned intervals are exact up to that tolerance.
Returns
a vector of vectors of intervals.

◆ level_sets() [4/4]

std::vector< std::vector< Interval > > Geom::level_sets ( SBasis const &  f,
std::vector< Interval > const &  levels,
double  a = 0.,
double  b = 1.,
double  tol = 1e-5 
)

'Solve' f(t)\in I=[u,v] for several intervals I at once.

Parameters
fsbasis function
levelsvector of 'y' intervals, that should be disjoints and sorted.
a,blimit search on domain [a,b]
tolthe bounds of the returned intervals are exact up to that tolerance.
Returns
a vector of vectors of intervals.

◆ line_intersection()

IntersectorKind Geom::line_intersection ( Geom::Point const &  n0,
double const  d0,
Geom::Point const &  n1,
double const  d1,
Geom::Point result 
)

Finds the intersection of the two (infinite) lines defined by the points p such that dot(n0, p) == d0 and dot(n1, p) == d1.

If the two lines intersect, then result becomes their point of intersection; otherwise, result remains unchanged.

This function finds the intersection of the two lines (infinite) defined by n0.X = d0 and x1.X = d1. The algorithm is as follows: To compute the intersection point use kramer's rule:

* convert lines to form
* ax + by = c
* dx + ey = f
*
* (
*  e.g. a = (x2 - x1), b = (y2 - y1), c = (x2 - x1)*x1 + (y2 - y1)*y1
* )
*
* In our case we use:
*   a = n0.x     d = n1.x
*   b = n0.y     e = n1.y
*   c = d0        f = d1
*
* so:
*
* adx + bdy = cd
* adx + aey = af
*
* bdy - aey = cd - af
* (bd - ae)y = cd - af
*
* y = (cd - af)/(bd - ae)
*
* repeat for x and you get:
*
* x = (fb - ce)/(bd - ae)                

If the denominator (bd-ae) is 0 then the lines are parallel, if the numerators are 0 then the lines coincide.

Todo:
Why not use existing but outcommented code below (HAVE_NEW_INTERSECTOR_CODE)?

Definition at line 67 of file geom.cpp.

References coincident, dot(), intersects, n1, parallel, result, rot90(), X, and Y.

Referenced by draw_line_in_rect(), line_segment_intersect(), line_twopoint_intersect(), segment_intersect(), and tighten().

◆ line_segment_intersect()

IntersectorKind Geom::line_segment_intersect ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11,
Geom::Point result 
)

Determine whether & where a line segments intersects an (infinite) line.

If there is no intersection, then result remains unchanged.

Precondition
neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 164 of file geom.cpp.

References dot(), line_intersection(), line_segment_intersectp(), n1, no_intersection, and result.

Referenced by rect_line_intersect().

◆ line_segment_intersectp()

bool Geom::line_segment_intersectp ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11 
)

Determine whether the line segment from p00 to p01 intersects the infinite line passing through p10 and p11.

This doesn't find the point of intersection, use the line_intersect function above, or the segment_intersection interface below.

Precondition
neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 128 of file geom.cpp.

References intersector_ccw().

Referenced by line_segment_intersect(), and segment_intersectp().

◆ line_twopoint_intersect()

IntersectorKind Geom::line_twopoint_intersect ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11,
Geom::Point result 
)

Determine whether & where two line segments intersect.

If the two segments don't intersect, then result remains unchanged.

Precondition
neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 211 of file geom.cpp.

References dot(), line_intersection(), n1, and result.

◆ linear_intersect()

bool Geom::linear_intersect ( Point const &  A0,
Point const &  A1,
Point const &  B0,
Point const &  B1,
double &  tA,
double &  tB,
double &  det 
)

Finds the intersection between the lines defined by A0 & A1, and B0 & B1.

Returns through the last 3 parameters, returning the t-values on the lines and the cross-product of the deltas (a useful byproduct). The return value indicates if the time values are within their proper range on the line segments.

Definition at line 76 of file path-intersection.cpp.

References are_near(), cross(), det(), and Geom::Point::length().

Referenced by mono_intersect(), mono_pair(), and pair_intersect().

◆ LInfty()

◆ Lmax()

double Geom::Lmax ( Point  p)

Definition at line 315 of file recursive-bezier-intersection.cpp.

References X, and Y.

◆ log() [1/2]

Piecewise< SBasis > Geom::log ( Piecewise< SBasis >const &  f,
double  tol = 1e-3,
int  order = 3 
)

◆ log() [2/2]

Piecewise< SBasis > Geom::log ( SBasis const &  f,
double  tol = 1e-3,
int  order = 3 
)

◆ log4()

double Geom::log4 ( double  x)
inline

Definition at line 305 of file recursive-bezier-intersection.cpp.

References log().

◆ make_angle_bisector_line() [1/2]

Line Geom::make_angle_bisector_line ( Line const &  l1,
Line const &  l2 
)

◆ make_angle_bisector_line() [2/2]

Line Geom::make_angle_bisector_line ( Point const &  A,
Point const &  O,
Point const &  B 
)
inline

Definition at line 504 of file line.h.

References Geom::AngleInterval::angleAt().

Referenced by make_angle_bisector_line(), and TEST().

◆ make_angle_bisector_ray()

Ray Geom::make_angle_bisector_ray ( Ray const &  r1,
Ray const &  r2,
bool  cw = true 
)
inline

Returns the angle bisector for the two given rays.

r1 is rotated half the way to r2 in either clockwise or counter-clockwise direction.

Precondition
Both passed rays must have the same origin.
Remarks
If the versors of both given rays point in the same direction, the direction of the angle bisector ray depends on the third parameter:
  • If cw is set to true, the returned ray will equal the passed rays r1 and r2.
  • If cw is set to false, the returned ray will go in the opposite direction.
Exceptions
RangeErrorif the given rays do not have the same origins

Definition at line 167 of file ray.h.

References angle_between(), are_near(), Geom::Ray::origin(), Geom::Ray::reverse(), and Geom::Ray::vector().

Referenced by wrap_ray().

◆ make_bisector_line()

Line Geom::make_bisector_line ( LineSegment const &  _segment)
inline

◆ make_cuts_independent()

◆ make_elliptical_arc()

◆ make_orthogonal_line()

Line Geom::make_orthogonal_line ( Point const &  p,
Line const &  line 
)
inline

Definition at line 479 of file line.h.

References Geom::Point::cw(), and Geom::Line::vector().

Referenced by make_bisector_line().

◆ make_parallel_line()

Line Geom::make_parallel_line ( Point const &  p,
Line const &  line 
)
inline

Definition at line 488 of file line.h.

References result.

Referenced by Inkscape::CanvasItemGridXY::_render().

◆ max() [1/5]

◆ max() [2/5]

Piecewise< SBasis > Geom::max ( Piecewise< SBasis > const &  f,
Piecewise< SBasis > const &  g 
)

Return the greater of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 87 of file sbasis-math.cpp.

References Geom::Piecewise< T >::cuts, max(), roots(), and Geom::Piecewise< T >::segs.

◆ max() [3/5]

Piecewise< SBasis > Geom::max ( Piecewise< SBasis > const &  f,
SBasis const &  g 
)

Return the greater of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 75 of file sbasis-math.cpp.

References max().

◆ max() [4/5]

Piecewise< SBasis > Geom::max ( SBasis const &  f,
Piecewise< SBasis > const &  g 
)

Return the greater of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 81 of file sbasis-math.cpp.

References max().

◆ max() [5/5]

Piecewise< SBasis > Geom::max ( SBasis const &  f,
SBasis const &  g 
)

Return the greater of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 69 of file sbasis-math.cpp.

References max().

◆ merge()

ConvexHull Geom::merge ( ConvexHull  a,
ConvexHull  b 
)

Definition at line 653 of file convex-hull.cpp.

References bridges(), idx_to_pair(), limit, Geom::ConvexHull::size(), size, and Y.

◆ merge_crossings()

void Geom::merge_crossings ( Crossings a,
Crossings b,
unsigned  i 
)

Definition at line 128 of file crossing.cpp.

References sort_crossings().

Referenced by Geom::MonoCrosser::crossings(), and crossings_among().

◆ middle_point()

◆ min() [1/4]

Piecewise< SBasis > Geom::min ( Piecewise< SBasis > const &  f,
Piecewise< SBasis > const &  g 
)

Return the more negative of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 116 of file sbasis-math.cpp.

References max(), and min().

◆ min() [2/4]

Piecewise< SBasis > Geom::min ( Piecewise< SBasis > const &  f,
SBasis const &  g 
)

Return the more negative of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 106 of file sbasis-math.cpp.

References max(), and min().

◆ min() [3/4]

Piecewise< SBasis > Geom::min ( SBasis const &  f,
Piecewise< SBasis > const &  g 
)

Return the more negative of the two functions pointwise.

Parameters
f,gtwo functions

Definition at line 111 of file sbasis-math.cpp.

References max(), and min().

◆ min() [4/4]

◆ mod()

int Geom::mod ( int  i,
int  l 
)

Definition at line 416 of file convex-hull.cpp.

◆ mono_intersect() [1/2]

void Geom::mono_intersect ( Curve const &  A,
double  Al,
double  Ah,
Curve const &  B,
double  Bl,
double  Bh,
Crossings ret,
double  tol = 0.1,
unsigned  depth = 0 
)

◆ mono_intersect() [2/2]

Crossings Geom::mono_intersect ( Curve const &  A,
Interval const &  Ad,
Curve const &  B,
Interval const &  Bd 
)

◆ mono_pair()

void Geom::mono_pair ( Path const &  A,
double  Al,
double  Ah,
Path const &  B,
double  Bl,
double  Bh,
Crossings ret,
double  ,
unsigned  depth = 0 
)

Takes two paths and time ranges on them, with the invariant that the paths are monotonic on the range.

Splits A when the linear intersection doesn't exist or is inaccurate. Uses the fact that it is monotonic to do very fast local bounds.

Definition at line 352 of file path-intersection.cpp.

References c, Geom::GenericRect< C >::intersects(), linear_intersect(), Geom::GenericRect< C >::maxExtent(), mono_pair(), and Geom::Path::pointAt().

Referenced by Geom::MonoCrosser::crossings(), and mono_pair().

◆ monotonic_smash_intersect()

◆ monotonicSplit()

std::vector< Interval > Geom::monotonicSplit ( D2< SBasis > const &  p)

Definition at line 73 of file intersection-by-smashing.cpp.

References derivative(), result, roots(), X, and Y.

Referenced by smash_intersect().

◆ multi_roots() [1/3]

std::vector< std::vector< double > > Geom::multi_roots ( Piecewise< SBasis > const &  f,
std::vector< double > const &  values 
)

◆ multi_roots() [2/3]

std::vector< std::vector< double > > Geom::multi_roots ( SBasis const &  f,
std::vector< double > const &  levels,
double  htol = 1e-7,
double  vtol = 1e-7,
double  a = 0,
double  b = 1 
)

◆ multi_roots() [3/3]

template<unsigned n>
std::vector< std::vector< double > > Geom::multi_roots ( SBasisN< n > const &  f,
std::vector< double > const &  levels,
double  htol = 1e-7,
double  vtol = 1e-7,
double  a = 0,
double  b = 1 
)

◆ multiply() [1/7]

◆ multiply() [2/7]

D2< SBasis > Geom::multiply ( Linear const &  a,
D2< SBasis > const &  b 
)

Definition at line 44 of file d2-sbasis.cpp.

References multiply(), X, and Y.

◆ multiply() [3/7]

D2< SBasis > Geom::multiply ( SBasis const &  a,
D2< SBasis > const &  b 
)

Definition at line 48 of file d2-sbasis.cpp.

References multiply(), X, and Y.

◆ multiply() [4/7]

SBasis Geom::multiply ( SBasis const &  a,
SBasis const &  b 
)

Compute the pointwise product of a and b (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a*b

Definition at line 228 of file sbasis.cpp.

References c, Geom::SBasis::isZero(), Geom::SBasis::normalize(), and Geom::SBasis::size().

◆ multiply() [5/7]

SBasis2d Geom::multiply ( SBasis2d const &  a,
SBasis2d const &  b 
)

◆ multiply() [6/7]

template<unsigned n>
SBasisN< n > Geom::multiply ( SBasisN< n > const &  a,
SBasisN< n > const &  b 
)

◆ multiply() [7/7]

template<typename T >
SBasisOf< T > Geom::multiply ( SBasisOf< T > const &  a,
SBasisOf< T > const &  b 
)

Definition at line 485 of file sbasis-of.h.

References c, Geom::SBasisOf< T >::isZero(), and multiply_add().

◆ multiply_add() [1/3]

SBasis Geom::multiply_add ( SBasis const &  a,
SBasis const &  b,
SBasis  c 
)

Compute the pointwise product of a and b adding c (Exact)

Parameters
a,b,csbasis functions
Returns
sbasis equal to a*b+c

The added term is almost free

Definition at line 259 of file sbasis.cpp.

References c, Geom::SBasis::isZero(), Geom::SBasis::normalize(), Geom::SBasis::resize(), and Geom::SBasis::size().

◆ multiply_add() [2/3]

template<unsigned n>
SBasisN< n > Geom::multiply_add ( SBasisN< n > const &  a,
SBasisN< n > const &  b,
SBasisN< n >  c 
)

◆ multiply_add() [3/3]

template<typename T >
SBasisOf< T > Geom::multiply_add ( SBasisOf< T > const &  a,
SBasisOf< T > const &  b,
SBasisOf< T >  c 
)

◆ nearest_time() [1/8]

◆ nearest_time() [2/8]

◆ nearest_time() [3/8]

double Geom::nearest_time ( Point const &  p,
D2< SBasis > const &  c,
D2< SBasis > const &  deriv,
double  from = 0,
double  to = 1 
)

Definition at line 103 of file nearest-time.cpp.

References c, dot(), and roots().

◆ nearest_time() [4/8]

double Geom::nearest_time ( Point const &  p,
D2< SBasis > const &  c,
double  from = 0,
double  to = 1 
)
inline

Definition at line 76 of file nearest-time.h.

References c, derivative(), and nearest_time().

◆ nearest_time() [5/8]

Coord Geom::nearest_time ( Point const &  p,
Path const &  c 
)
inline

Definition at line 868 of file path.h.

References c, Geom::PathTime::curve_index, and Geom::PathTime::t.

◆ nearest_time() [6/8]

double Geom::nearest_time ( Point const &  p,
Piecewise< D2< SBasis > > const &  c 
)
inline

Definition at line 111 of file nearest-time.h.

References c, and nearest_time().

◆ nearest_time() [7/8]

double Geom::nearest_time ( Point const &  p,
Piecewise< D2< SBasis > > const &  c,
double  from,
double  to 
)

Definition at line 192 of file nearest-time.cpp.

References bounds_fast(), c, distanceSq(), and nearest_time().

◆ nearest_time() [8/8]

double Geom::nearest_time ( Point const &  p,
Point const &  A,
Point const &  v 
)
inline

Definition at line 54 of file nearest-time.h.

◆ new_clone()

Curve * Geom::new_clone ( Curve const &  c)
inline

Definition at line 360 of file curve.h.

References c, and Geom::Curve::duplicate().

◆ NewtonRaphsonRootFind()

static double Geom::NewtonRaphsonRootFind ( Point const  Q[],
Point const &  P,
double const  u 
)
static

Use Newton-Raphson iteration to find better root.

Parameters
QCurrent fitted curve
PDigitized point
uParameter value for "P"
Returns
Improved u

Definition at line 567 of file bezier-utils.cpp.

References bezier_pt(), dot(), and lensq().

Referenced by reparameterize().

◆ non_collinear_segments_intersect()

bool Geom::non_collinear_segments_intersect ( const Point A,
const Point B,
const Point C,
const Point D 
)

Check if two line segments intersect.

If they are collinear, the result is undefined.

Returns
True if line segments AB and CD intersect

Definition at line 477 of file basic-intersection.cpp.

References cross(), and D.

Referenced by Geom::Parallelogram::intersects().

◆ offset_crossings()

void Geom::offset_crossings ( Crossings cr,
double  a,
double  b 
)

Definition at line 136 of file crossing.cpp.

Referenced by curve_sweep(), and self_crossings().

◆ offset_doubles()

std::vector< double > Geom::offset_doubles ( std::vector< double > const &  x,
double  offs 
)

Convenience function to add a value to each entry in a vector of doubles.

Definition at line 398 of file path-intersection.cpp.

Referenced by path_mono_splits().

◆ operator!=() [1/4]

template<typename T >
bool Geom::operator!= ( D2< T > const &  a,
D2< T > const &  b 
)
inline

Definition at line 183 of file d2.h.

◆ operator!=() [2/4]

bool Geom::operator!= ( Linear2d const &  a,
Linear2d const &  b 
)
inline

Definition at line 140 of file sbasis-2d.h.

◆ operator!=() [3/4]

template<unsigned n>
bool Geom::operator!= ( LinearN< n > const &  a,
LinearN< n > const &  b 
)
inline

Definition at line 289 of file linearN.h.

◆ operator!=() [4/4]

template<typename T >
bool Geom::operator!= ( LinearOf< T > const &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 213 of file linear-of.h.

◆ operator&() [1/2]

OptIntRect Geom::operator& ( IntRect const &  a,
IntRect const &  b 
)
inline

Definition at line 44 of file int-rect.h.

References Geom::GenericOptRect< C >::intersectWith().

◆ operator&() [2/2]

OptRect Geom::operator& ( Rect const &  a,
Rect const &  b 
)
inline

Definition at line 245 of file rect.h.

References Geom::GenericOptRect< C >::intersectWith().

◆ operator*() [1/23]

Bezier Geom::operator* ( Bezier const &  f,
Bezier const &  g 
)

Definition at line 221 of file bezier.cpp.

References binomial_increment_k(), and Geom::Bezier::order().

◆ operator*() [2/23]

template<typename T >
D2< T > Geom::operator* ( D2< T > const &  a,
double  b 
)
inline

Definition at line 286 of file d2.h.

◆ operator*() [3/23]

template<typename T >
D2< T > Geom::operator* ( D2< T > const &  a,
Point const &  b 
)
inline

Definition at line 248 of file d2.h.

◆ operator*() [4/23]

template<typename T >
D2< T > Geom::operator* ( D2< T > const &  a,
T const &  b 
)
inline

Definition at line 307 of file d2.h.

◆ operator*() [5/23]

template<typename T >
D2< T > Geom::operator* ( D2< T > const &  v,
Affine const &  m 
)

Definition at line 295 of file d2.h.

References X, and Y.

◆ operator*() [6/23]

Poly Geom::operator* ( double  a,
Poly const &  b 
)
inline

Definition at line 197 of file polynomial.h.

◆ operator*() [7/23]

Linear2d Geom::operator* ( double const  a,
Linear2d const &  b 
)
inline

Definition at line 146 of file sbasis-2d.h.

◆ operator*() [8/23]

SBasis Geom::operator* ( double  k,
SBasis const &  a 
)
inline

Definition at line 290 of file sbasis.h.

◆ operator*() [9/23]

SBasis2d Geom::operator* ( double  k,
SBasis2d const &  a 
)

◆ operator*() [10/23]

template<unsigned n>
SBasisN< n > Geom::operator* ( double  k,
SBasisN< n > const &  a 
)
inline

Definition at line 696 of file sbasisN.h.

◆ operator*() [11/23]

template<typename T >
SBasisOf< T > Geom::operator* ( double  k,
SBasisOf< T > const &  a 
)
inline

Definition at line 221 of file sbasis-of.h.

◆ operator*() [12/23]

D2< SBasis > Geom::operator* ( Linear const &  a,
D2< SBasis > const &  b 
)
inline

Definition at line 497 of file d2.h.

References multiply().

◆ operator*() [13/23]

template<unsigned n>
LinearN< n > Geom::operator* ( LinearN< n > const &  a,
double  b 
)
inline

Definition at line 302 of file linearN.h.

◆ operator*() [14/23]

template<typename T >
LinearOf< T > Geom::operator* ( LinearOf< T > const &  a,
double  b 
)
inline

Definition at line 222 of file linear-of.h.

◆ operator*() [15/23]

Piecewise< D2< SBasis > > Geom::operator* ( Piecewise< D2< SBasis > > const &  a,
Affine const &  m 
)

Definition at line 158 of file d2-sbasis.cpp.

References Geom::Piecewise< T >::push_cut(), and result.

◆ operator*() [16/23]

D2< SBasis > Geom::operator* ( SBasis const &  a,
D2< SBasis > const &  b 
)
inline

Definition at line 499 of file d2.h.

References multiply().

◆ operator*() [17/23]

SBasis Geom::operator* ( SBasis const &  a,
double  k 
)

Compute the pointwise product of a and b (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a*b

Definition at line 170 of file sbasis.cpp.

References c, and Geom::SBasis::size().

◆ operator*() [18/23]

SBasis Geom::operator* ( SBasis const &  a,
SBasis const &  b 
)
inline

Definition at line 380 of file sbasis.h.

References multiply().

◆ operator*() [19/23]

SBasis2d Geom::operator* ( SBasis2d const &  a,
SBasis2d const &  b 
)

◆ operator*() [20/23]

template<unsigned n>
SBasisN< n > Geom::operator* ( SBasisN< n > const &  a,
double  c 
)

Definition at line 683 of file sbasisN.h.

References c, Geom::SBasisN< n >::isZero(), result, and Geom::SBasisN< n >::sizes.

◆ operator*() [21/23]

template<unsigned n>
SBasisN< n > Geom::operator* ( SBasisN< n > const &  a,
SBasisN< n > const &  b 
)
inline

Definition at line 947 of file sbasisN.h.

References multiply().

◆ operator*() [22/23]

template<typename T >
SBasisOf< T > Geom::operator* ( SBasisOf< T > const &  a,
double  k 
)

Definition at line 211 of file sbasis-of.h.

References c.

◆ operator*() [23/23]

template<typename T >
SBasisOf< T > Geom::operator* ( SBasisOf< T > const &  a,
SBasisOf< T > const &  b 
)
inline

Definition at line 552 of file sbasis-of.h.

References multiply().

◆ operator*=() [1/13]

template<typename T >
D2< T > Geom::operator*= ( D2< T > &  a,
double  b 
)
inline

Definition at line 288 of file d2.h.

◆ operator*=() [2/13]

template<typename T >
D2< T > Geom::operator*= ( D2< T > &  a,
Point const &  b 
)
inline

Definition at line 268 of file d2.h.

◆ operator*=() [3/13]

Linear2d & Geom::operator*= ( Linear2d a,
double  b 
)
inline

Definition at line 128 of file sbasis-2d.h.

◆ operator*=() [4/13]

template<unsigned n>
LinearN< n > Geom::operator*= ( LinearN< n > &  a,
double  b 
)
inline

Definition at line 318 of file linearN.h.

◆ operator*=() [5/13]

template<typename T >
LinearOf< T > Geom::operator*= ( LinearOf< T > &  a,
double  b 
)
inline

Definition at line 230 of file linear-of.h.

◆ operator*=() [6/13]

template<typename T >
Piecewise< T > & Geom::operator*= ( Piecewise< T > &  a,
double  b 
)

Definition at line 637 of file piecewise.h.

References Geom::Piecewise< T >::size().

◆ operator*=() [7/13]

SBasis & Geom::operator*= ( SBasis a,
double  b 
)

Compute the pointwise product of a and b and store the value in a (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a*b

Definition at line 182 of file sbasis.cpp.

References Geom::SBasis::clear(), and Geom::SBasis::isZero().

◆ operator*=() [8/13]

SBasis & Geom::operator*= ( SBasis a,
SBasis const &  b 
)
inline

Definition at line 384 of file sbasis.h.

References multiply().

◆ operator*=() [9/13]

SBasis2d & Geom::operator*= ( SBasis2d a,
double  b 
)
inline

Definition at line 291 of file sbasis-2d.h.

◆ operator*=() [10/13]

template<unsigned n>
SBasisN< n > & Geom::operator*= ( SBasisN< n > &  a,
double  c 
)

Definition at line 700 of file sbasisN.h.

References c.

◆ operator*=() [11/13]

template<unsigned n>
SBasisN< n > & Geom::operator*= ( SBasisN< n > &  a,
SBasisN< n > const &  b 
)
inline

Definition at line 952 of file sbasisN.h.

References multiply().

◆ operator*=() [12/13]

template<typename T >
SBasisOf< T > & Geom::operator*= ( SBasisOf< T > &  a,
double  b 
)

Definition at line 225 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero().

◆ operator*=() [13/13]

template<typename T >
SBasisOf< T > & Geom::operator*= ( SBasisOf< T > &  a,
SBasisOf< T > const &  b 
)
inline

Definition at line 557 of file sbasis-of.h.

References multiply().

◆ operator+() [1/17]

SBasis Geom::operator+ ( const SBasis a,
const SBasis b 
)

Compute the pointwise sum of a and b (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a+b

Definition at line 88 of file sbasis.cpp.

References result, and Geom::SBasis::size().

◆ operator+() [2/17]

SBasis Geom::operator+ ( const SBasis a,
double  b 
)
inline

Definition at line 331 of file sbasis.h.

References result.

◆ operator+() [3/17]

SBasis2d Geom::operator+ ( const SBasis2d a,
const SBasis2d b 
)
inline

Definition at line 215 of file sbasis-2d.h.

References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.

◆ operator+() [4/17]

template<unsigned n>
SBasisN< n > Geom::operator+ ( const SBasisN< n > &  a,
const SBasisN< n > &  b 
)

◆ operator+() [5/17]

template<unsigned n>
SBasisN< n > Geom::operator+ ( const SBasisN< n > &  a,
double  b 
)
inline

Definition at line 784 of file sbasisN.h.

References Geom::SBasisN< n >::isZero(), and result.

◆ operator+() [6/17]

template<unsigned n>
SBasisN< n > Geom::operator+ ( const SBasisN< n > &  a,
LinearN< n > const &  b 
)
inline

Definition at line 749 of file sbasisN.h.

References Geom::LinearN< n >::isZero(), Geom::SBasisN< n >::isZero(), and result.

◆ operator+() [7/17]

template<typename T >
SBasisOf< T > Geom::operator+ ( const SBasisOf< T > &  a,
const SBasisOf< T > &  b 
)
inline

Definition at line 266 of file sbasis-of.h.

References result.

◆ operator+() [8/17]

template<typename T >
SBasisOf< T > Geom::operator+ ( const SBasisOf< T > &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 337 of file sbasis-of.h.

References Geom::LinearOf< T >::isZero(), Geom::SBasisOf< T >::isZero(), and result.

◆ operator+() [9/17]

template<typename T >
SBasisOf< T > Geom::operator+ ( const SBasisOf< T > &  a,
b 
)
inline

Definition at line 403 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero(), and result.

◆ operator+() [10/17]

template<typename T >
D2< T > Geom::operator+ ( D2< T > const &  a,
D2< T > const &  b 
)
inline

Definition at line 199 of file d2.h.

◆ operator+() [11/17]

template<typename T >
D2< T > Geom::operator+ ( D2< T > const &  a,
Point  b 
)
inline

Definition at line 320 of file d2.h.

◆ operator+() [12/17]

Linear2d Geom::operator+ ( Linear2d const &  a,
Linear2d const &  b 
)
inline

Definition at line 106 of file sbasis-2d.h.

◆ operator+() [13/17]

template<unsigned n>
LinearN< n > Geom::operator+ ( LinearN< n > const &  a,
double  b 
)
inline

Definition at line 251 of file linearN.h.

◆ operator+() [14/17]

template<unsigned n>
LinearN< n > Geom::operator+ ( LinearN< n > const &  a,
LinearN< n > const &  b 
)
inline

Definition at line 220 of file linearN.h.

◆ operator+() [15/17]

template<typename T >
LinearOf< T > Geom::operator+ ( LinearOf< T > const &  a,
double  b 
)
inline

Definition at line 168 of file linear-of.h.

◆ operator+() [16/17]

template<typename T >
LinearOf< T > Geom::operator+ ( LinearOf< T > const &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 149 of file linear-of.h.

◆ operator+() [17/17]

template<unsigned n>
MultiDegree< n > Geom::operator+ ( MultiDegree< n > const &  p,
MultiDegree< n > const &  q 
)

Definition at line 167 of file sbasisN.h.

References Geom::MultiDegree< n >::p.

◆ operator+=() [1/20]

template<typename T >
D2< T > Geom::operator+= ( D2< T > &  a,
D2< T > const &  b 
)
inline

Definition at line 219 of file d2.h.

◆ operator+=() [2/20]

template<typename T >
D2< T > Geom::operator+= ( D2< T > &  a,
Point  b 
)
inline

Definition at line 338 of file d2.h.

◆ operator+=() [3/20]

Linear2d & Geom::operator+= ( Linear2d a,
Linear2d const &  b 
)
inline

Definition at line 118 of file sbasis-2d.h.

◆ operator+=() [4/20]

template<unsigned n>
LinearN< n > & Geom::operator+= ( LinearN< n > &  a,
double  b 
)
inline

Definition at line 267 of file linearN.h.

◆ operator+=() [5/20]

template<unsigned n>
LinearN< n > & Geom::operator+= ( LinearN< n > &  a,
LinearN< n > const &  b 
)
inline

Definition at line 236 of file linearN.h.

◆ operator+=() [6/20]

template<typename T >
LinearOf< T > & Geom::operator+= ( LinearOf< T > &  a,
double  b 
)
inline

Definition at line 176 of file linear-of.h.

◆ operator+=() [7/20]

template<typename T >
LinearOf< T > & Geom::operator+= ( LinearOf< T > &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 157 of file linear-of.h.

◆ operator+=() [8/20]

template<unsigned n>
MultiDegree< n > Geom::operator+= ( MultiDegree< n > const &  p,
MultiDegree< n > const &  q 
)

Definition at line 175 of file sbasisN.h.

◆ operator+=() [9/20]

template<typename T >
Piecewise< T > & Geom::operator+= ( Piecewise< T > &  a,
Piecewise< T > const &  b 
)
inline

Definition at line 693 of file piecewise.h.

◆ operator+=() [10/20]

template<typename T >
Piecewise< T > & Geom::operator+= ( Piecewise< T > &  a,
typename T::output_type  b 
)

◆ operator+=() [11/20]

SBasis & Geom::operator+= ( SBasis a,
const SBasis b 
)

Compute the pointwise sum of a and b and store in a (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a+b

Definition at line 132 of file sbasis.cpp.

References Geom::SBasis::resize(), and Geom::SBasis::size().

◆ operator+=() [12/20]

SBasis & Geom::operator+= ( SBasis a,
double  b 
)
inline

Definition at line 343 of file sbasis.h.

References Geom::SBasis::SBasis().

◆ operator+=() [13/20]

SBasis2d & Geom::operator+= ( SBasis2d a,
const Linear2d b 
)
inline

Definition at line 256 of file sbasis-2d.h.

◆ operator+=() [14/20]

SBasis2d & Geom::operator+= ( SBasis2d a,
double  b 
)
inline

Definition at line 272 of file sbasis-2d.h.

◆ operator+=() [15/20]

template<unsigned n>
SBasisN< n > & Geom::operator+= ( SBasisN< n > &  a,
const LinearN< n > &  b 
)
inline

Definition at line 766 of file sbasisN.h.

◆ operator+=() [16/20]

template<unsigned n>
SBasisN< n > & Geom::operator+= ( SBasisN< n > &  a,
const SBasisN< n > &  b 
)

Definition at line 736 of file sbasisN.h.

References Geom::SBasisN< n >::isZero().

◆ operator+=() [17/20]

template<unsigned n>
SBasisN< n > & Geom::operator+= ( SBasisN< n > &  a,
double  b 
)
inline

Definition at line 798 of file sbasisN.h.

◆ operator+=() [18/20]

template<typename T >
SBasisOf< T > & Geom::operator+= ( SBasisOf< T > &  a,
const LinearOf< T > &  b 
)
inline

Definition at line 352 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero().

◆ operator+=() [19/20]

template<typename T >
SBasisOf< T > & Geom::operator+= ( SBasisOf< T > &  a,
const SBasisOf< T > &  b 
)

Definition at line 306 of file sbasis-of.h.

◆ operator+=() [20/20]

template<typename T >
SBasisOf< T > & Geom::operator+= ( SBasisOf< T > &  a,
b 
)
inline

Definition at line 417 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero().

◆ operator-() [1/25]

SBasis Geom::operator- ( const SBasis a,
const SBasis b 
)

Compute the pointwise difference of a and b (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a-b

Definition at line 110 of file sbasis.cpp.

References result, and Geom::SBasis::size().

◆ operator-() [2/25]

SBasis Geom::operator- ( const SBasis a,
double  b 
)
inline

Definition at line 337 of file sbasis.h.

References result.

◆ operator-() [3/25]

SBasis Geom::operator- ( const SBasis p)
inline

Definition at line 280 of file sbasis.h.

References result, and Geom::SBasis::SBasis().

◆ operator-() [4/25]

SBasis2d Geom::operator- ( const SBasis2d a,
const SBasis2d b 
)
inline

Definition at line 235 of file sbasis-2d.h.

References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.

◆ operator-() [5/25]

SBasis2d Geom::operator- ( const SBasis2d p)
inline

Definition at line 205 of file sbasis-2d.h.

References result.

◆ operator-() [6/25]

template<unsigned n>
SBasisN< n > Geom::operator- ( const SBasisN< n > &  a,
const SBasisN< n > &  b 
)

Definition at line 734 of file sbasisN.h.

◆ operator-() [7/25]

template<unsigned n>
SBasisN< n > Geom::operator- ( const SBasisN< n > &  a,
double  b 
)
inline

Definition at line 791 of file sbasisN.h.

References Geom::SBasisN< n >::isZero(), and result.

◆ operator-() [8/25]

template<unsigned n>
SBasisN< n > Geom::operator- ( const SBasisN< n > &  a,
LinearN< n > const &  b 
)
inline

Definition at line 758 of file sbasisN.h.

References Geom::LinearN< n >::isZero(), Geom::SBasisN< n >::isZero(), and result.

◆ operator-() [9/25]

template<unsigned n>
SBasisN< n > Geom::operator- ( const SBasisN< n > &  p)
inline

Returns a function which reverses the domain of a.

Parameters
asbasis function

useful for reversing a parameteric curve.

Definition at line 670 of file sbasisN.h.

References Geom::SBasisN< n >::isZero(), result, and Geom::SBasisN< n >::sizes.

◆ operator-() [10/25]

template<typename T >
SBasisOf< T > Geom::operator- ( const SBasisOf< T > &  a,
const SBasisOf< T > &  b 
)

Definition at line 286 of file sbasis-of.h.

References result.

◆ operator-() [11/25]

template<typename T >
SBasisOf< T > Geom::operator- ( const SBasisOf< T > &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 345 of file sbasis-of.h.

References Geom::LinearOf< T >::isZero(), and result.

◆ operator-() [12/25]

template<typename T >
SBasisOf< T > Geom::operator- ( const SBasisOf< T > &  a,
b 
)
inline

Definition at line 410 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero(), and result.

◆ operator-() [13/25]

template<typename T >
SBasisOf< T > Geom::operator- ( const SBasisOf< T > &  p)
inline

Definition at line 199 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero(), and result.

◆ operator-() [14/25]

template<typename T >
D2< T > Geom::operator- ( D2< T > const &  a)
inline

Definition at line 239 of file d2.h.

◆ operator-() [15/25]

template<typename T >
D2< T > Geom::operator- ( D2< T > const &  a,
D2< T > const &  b 
)
inline

Definition at line 209 of file d2.h.

◆ operator-() [16/25]

template<typename T >
D2< T > Geom::operator- ( D2< T > const &  a,
Point  b 
)
inline

Definition at line 329 of file d2.h.

◆ operator-() [17/25]

Linear2d Geom::operator- ( Linear2d const &  a)
inline

Definition at line 102 of file sbasis-2d.h.

References Geom::Linear2d::a.

◆ operator-() [18/25]

Linear2d Geom::operator- ( Linear2d const &  a,
Linear2d const &  b 
)
inline

Definition at line 112 of file sbasis-2d.h.

◆ operator-() [19/25]

template<unsigned n>
LinearN< n > Geom::operator- ( LinearN< n > const &  a)
inline

Definition at line 294 of file linearN.h.

◆ operator-() [20/25]

template<unsigned n>
LinearN< n > Geom::operator- ( LinearN< n > const &  a,
double  b 
)
inline

Definition at line 259 of file linearN.h.

◆ operator-() [21/25]

template<unsigned n>
LinearN< n > Geom::operator- ( LinearN< n > const &  a,
LinearN< n > const &  b 
)
inline

Definition at line 228 of file linearN.h.

◆ operator-() [22/25]

template<typename T >
LinearOf< T > Geom::operator- ( LinearOf< T > const &  a)
inline

Definition at line 218 of file linear-of.h.

◆ operator-() [23/25]

template<typename T >
LinearOf< T > Geom::operator- ( LinearOf< T > const &  a,
double  b 
)
inline

Definition at line 172 of file linear-of.h.

◆ operator-() [24/25]

template<typename T >
LinearOf< T > Geom::operator- ( LinearOf< T > const &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 153 of file linear-of.h.

◆ operator-() [25/25]

template<typename T >
Piecewise< T > Geom::operator- ( Piecewise< T > const &  a,
typename T::output_type  b 
)

◆ operator-=() [1/19]

template<typename T >
D2< T > Geom::operator-= ( D2< T > &  a,
D2< T > const &  b 
)
inline

Definition at line 228 of file d2.h.

◆ operator-=() [2/19]

template<typename T >
D2< T > Geom::operator-= ( D2< T > &  a,
Point  b 
)
inline

Definition at line 346 of file d2.h.

◆ operator-=() [3/19]

Linear2d & Geom::operator-= ( Linear2d a,
Linear2d const &  b 
)
inline

Definition at line 123 of file sbasis-2d.h.

◆ operator-=() [4/19]

template<unsigned n>
LinearN< n > & Geom::operator-= ( LinearN< n > &  a,
double  b 
)
inline

Definition at line 274 of file linearN.h.

◆ operator-=() [5/19]

template<unsigned n>
LinearN< n > & Geom::operator-= ( LinearN< n > &  a,
LinearN< n > const &  b 
)
inline

Definition at line 243 of file linearN.h.

◆ operator-=() [6/19]

template<typename T >
LinearOf< T > & Geom::operator-= ( LinearOf< T > &  a,
double  b 
)
inline

Definition at line 181 of file linear-of.h.

◆ operator-=() [7/19]

template<typename T >
LinearOf< T > & Geom::operator-= ( LinearOf< T > &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 162 of file linear-of.h.

◆ operator-=() [8/19]

template<typename T >
Piecewise< T > & Geom::operator-= ( Piecewise< T > &  a,
Piecewise< T > const &  b 
)
inline

Definition at line 698 of file piecewise.h.

◆ operator-=() [9/19]

template<typename T >
Piecewise< T > & Geom::operator-= ( Piecewise< T > &  a,
typename T::output_type  b 
)

◆ operator-=() [10/19]

SBasis & Geom::operator-= ( SBasis a,
const SBasis b 
)

Compute the pointwise difference of a and b and store in a (Exact)

Parameters
a,bsbasis functions
Returns
sbasis equal to a-b

Definition at line 151 of file sbasis.cpp.

References Geom::SBasis::resize(), and Geom::SBasis::size().

◆ operator-=() [11/19]

SBasis & Geom::operator-= ( SBasis a,
double  b 
)
inline

Definition at line 350 of file sbasis.h.

References Geom::SBasis::SBasis().

◆ operator-=() [12/19]

SBasis2d & Geom::operator-= ( SBasis2d a,
const Linear2d b 
)
inline

Definition at line 264 of file sbasis-2d.h.

◆ operator-=() [13/19]

SBasis2d & Geom::operator-= ( SBasis2d a,
double  b 
)
inline

Definition at line 282 of file sbasis-2d.h.

◆ operator-=() [14/19]

template<unsigned n>
SBasisN< n > & Geom::operator-= ( SBasisN< n > &  a,
const LinearN< n > &  b 
)
inline

Definition at line 774 of file sbasisN.h.

◆ operator-=() [15/19]

template<unsigned n>
SBasisN< n > & Geom::operator-= ( SBasisN< n > &  a,
const SBasisN< n > &  b 
)

Definition at line 742 of file sbasisN.h.

◆ operator-=() [16/19]

template<unsigned n>
SBasisN< n > & Geom::operator-= ( SBasisN< n > &  a,
double  b 
)
inline

Definition at line 806 of file sbasisN.h.

◆ operator-=() [17/19]

template<typename T >
SBasisOf< T > & Geom::operator-= ( SBasisOf< T > &  a,
const LinearOf< T > &  b 
)
inline

Definition at line 360 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero().

◆ operator-=() [18/19]

template<typename T >
SBasisOf< T > & Geom::operator-= ( SBasisOf< T > &  a,
const SBasisOf< T > &  b 
)

Definition at line 321 of file sbasis-of.h.

◆ operator-=() [19/19]

template<typename T >
SBasisOf< T > & Geom::operator-= ( SBasisOf< T > &  a,
b 
)
inline

Definition at line 425 of file sbasis-of.h.

References Geom::SBasisOf< T >::isZero().

◆ operator/() [1/7]

template<typename T >
D2< T > Geom::operator/ ( D2< T > const &  a,
double  b 
)
inline

Definition at line 290 of file d2.h.

◆ operator/() [2/7]

template<typename T >
D2< T > Geom::operator/ ( D2< T > const &  a,
Point const &  b 
)
inline

Definition at line 258 of file d2.h.

◆ operator/() [3/7]

template<unsigned n>
LinearN< n > Geom::operator/ ( LinearN< n > const &  a,
double  b 
)
inline

Definition at line 310 of file linearN.h.

◆ operator/() [4/7]

template<typename T >
LinearOf< T > Geom::operator/ ( LinearOf< T > const &  a,
double  b 
)
inline

Definition at line 226 of file linear-of.h.

◆ operator/() [5/7]

SBasis Geom::operator/ ( SBasis const &  a,
double  k 
)
inline

Definition at line 291 of file sbasis.h.

◆ operator/() [6/7]

template<unsigned n>
SBasisN< n > Geom::operator/ ( SBasisN< n > const &  a,
double  k 
)
inline

Definition at line 698 of file sbasisN.h.

◆ operator/() [7/7]

template<typename T >
SBasisOf< T > Geom::operator/ ( SBasisOf< T > const &  a,
double  k 
)
inline

Definition at line 223 of file sbasis-of.h.

◆ operator/=() [1/9]

template<typename T >
D2< T > Geom::operator/= ( D2< T > &  a,
double  b 
)
inline

Definition at line 292 of file d2.h.

◆ operator/=() [2/9]

template<typename T >
D2< T > Geom::operator/= ( D2< T > &  a,
Point const &  b 
)
inline

Definition at line 277 of file d2.h.

◆ operator/=() [3/9]

template<unsigned n>
LinearN< n > Geom::operator/= ( LinearN< n > &  a,
double  b 
)
inline

Definition at line 325 of file linearN.h.

◆ operator/=() [4/9]

template<typename T >
LinearOf< T > Geom::operator/= ( LinearOf< T > &  a,
double  b 
)
inline

Definition at line 235 of file linear-of.h.

◆ operator/=() [5/9]

template<typename T >
Piecewise< T > & Geom::operator/= ( Piecewise< T > &  a,
double  b 
)

Definition at line 645 of file piecewise.h.

References Geom::Piecewise< T >::size().

◆ operator/=() [6/9]

SBasis & Geom::operator/= ( SBasis a,
double  b 
)
inline

Definition at line 293 of file sbasis.h.

◆ operator/=() [7/9]

SBasis2d & Geom::operator/= ( SBasis2d a,
double  b 
)
inline

Definition at line 297 of file sbasis-2d.h.

◆ operator/=() [8/9]

template<unsigned n>
SBasisN< n > & Geom::operator/= ( SBasisN< n > &  a,
double  b 
)
inline

Definition at line 705 of file sbasisN.h.

◆ operator/=() [9/9]

template<typename T >
SBasisOf< T > & Geom::operator/= ( SBasisOf< T > &  a,
double  b 
)
inline

Definition at line 236 of file sbasis-of.h.

◆ operator<<() [1/27]

◆ operator<<() [2/27]

std::ostream & Geom::operator<< ( std::ostream &  os,
PathIntersectionGraph const &  pig 
)

Format the PathIntersectionGraph for output.

Definition at line 509 of file intersection-graph.cpp.

◆ operator<<() [3/27]

std::ostream & Geom::operator<< ( std::ostream &  os,
PathTime const &  pos 
)
inline

◆ operator<<() [4/27]

std::ostream & Geom::operator<< ( std::ostream &  os,
PathVectorTime const &  pvt 
)
inline

◆ operator<<() [5/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
Circle const &  c 
)

Definition at line 320 of file circle.cpp.

References c, format_coord_nice(), and operator<<().

◆ operator<<() [6/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
Ellipse const &  e 
)
related

Definition at line 769 of file ellipse.cpp.

◆ operator<<() [7/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
EllipticalArc const &  ea 
)
related

Definition at line 1023 of file elliptical-arc.cpp.

◆ operator<<() [8/27]

template<typename C >
std::ostream & Geom::operator<< ( std::ostream &  out,
GenericInterval< C > const &  I 
)
inline

Definition at line 354 of file generic-interval.h.

References operator<<().

◆ operator<<() [9/27]

template<typename C >
std::ostream & Geom::operator<< ( std::ostream &  out,
GenericOptInterval< C > const &  I 
)
inline

Definition at line 360 of file generic-interval.h.

References operator<<().

◆ operator<<() [10/27]

template<typename C >
std::ostream & Geom::operator<< ( std::ostream &  out,
GenericOptRect< C > const &  r 
)
inline

Definition at line 534 of file generic-rect.h.

References operator<<().

◆ operator<<() [11/27]

template<typename C >
std::ostream & Geom::operator<< ( std::ostream &  out,
GenericRect< C > const &  r 
)
inline

Definition at line 529 of file generic-rect.h.

References operator<<(), X, and Y.

◆ operator<<() [12/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
Geom::ConvexHull const &  hull 
)
inline

Output operator for convex hulls.

Prints out all the coordinates.

Definition at line 319 of file convex-hull.h.

References operator<<().

◆ operator<<() [13/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
Geom::Point const &  p 
)
related

Definition at line 256 of file point.cpp.

◆ operator<<() [14/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
Path const &  path 
)

Definition at line 1142 of file path.cpp.

References Geom::PathSink::feed(), operator<<(), and Geom::SVGPathWriter::str().

◆ operator<<() [15/27]

std::ostream & Geom::operator<< ( std::ostream &  out,
PathVector const &  pv 
)

Definition at line 317 of file pathvector.cpp.

References Geom::PathSink::feed(), operator<<(), and Geom::SVGPathWriter::str().

◆ operator<<() [16/27]

template<typename T >
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const Geom::D2< T > &  in_d2 
)
inline

A function to print out the Point.

It just prints out the coords on the given output stream

Definition at line 463 of file d2.h.

References X, and Y.

◆ operator<<() [17/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const Linear bo 
)
inline

Definition at line 428 of file sbasis.h.

◆ operator<<() [18/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const Linear2d bo 
)
inline

Definition at line 340 of file sbasis-2d.h.

◆ operator<<() [19/27]

template<unsigned n>
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const LinearN< n > &  bo 
)
inline

Definition at line 342 of file linearN.h.

◆ operator<<() [20/27]

template<typename T >
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const LinearOf< T > &  bo 
)
inline

Definition at line 612 of file sbasis-of.h.

◆ operator<<() [21/27]

template<unsigned n>
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const MultiDegree< n > &  d 
)
inline

Definition at line 986 of file sbasisN.h.

◆ operator<<() [22/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const Poly in_poly 
)
inline

Definition at line 237 of file polynomial.h.

◆ operator<<() [23/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const SBasis p 
)
inline

Definition at line 433 of file sbasis.h.

◆ operator<<() [24/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const SBasis2d p 
)
inline

Definition at line 346 of file sbasis-2d.h.

◆ operator<<() [25/27]

template<unsigned n>
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const SBasisN< n > &  p 
)
inline

Definition at line 994 of file sbasisN.h.

References Geom::SBasisN< n >::sizes.

◆ operator<<() [26/27]

template<typename T >
std::ostream & Geom::operator<< ( std::ostream &  out_file,
const SBasisOf< T > &  p 
)
inline

Definition at line 618 of file sbasis-of.h.

◆ operator<<() [27/27]

std::ostream & Geom::operator<< ( std::ostream &  out_file,
const xAx x 
)
inline

Definition at line 515 of file conicsec.h.

References Geom::xAx::c.

◆ operator<=()

template<unsigned n>
bool Geom::operator<= ( MultiDegree< n > const &  p,
MultiDegree< n > const &  q 
)

MultiDegree comparison.

A MultiDegree

Parameters
pis smaller than another
qif all it's smaller for all variables.

In particular, p<=q and q<=p can both be false!

Definition at line 190 of file sbasisN.h.

◆ operator==() [1/4]

template<typename T >
bool Geom::operator== ( D2< T > const &  a,
D2< T > const &  b 
)
inline

Definition at line 177 of file d2.h.

References operator==().

Referenced by operator==(), operator==(), operator==(), operator==(), and Geom::SL::operator==().

◆ operator==() [2/4]

bool Geom::operator== ( Linear2d const &  a,
Linear2d const &  b 
)
inline

Definition at line 134 of file sbasis-2d.h.

References operator==().

◆ operator==() [3/4]

template<unsigned n>
bool Geom::operator== ( LinearN< n > const &  a,
LinearN< n > const &  b 
)
inline

Definition at line 282 of file linearN.h.

References operator==().

◆ operator==() [4/4]

template<typename T >
bool Geom::operator== ( LinearOf< T > const &  a,
LinearOf< T > const &  b 
)
inline

Definition at line 209 of file linear-of.h.

References operator==().

◆ pair_intersect() [1/2]

void Geom::pair_intersect ( Curve const &  A,
double  Al,
double  Ah,
Curve const &  B,
double  Bl,
double  Bh,
Crossings ret,
unsigned  depth = 0 
)

This uses the local bounds functions of curves to generically intersect two.

It passes in the curves, time intervals, and keeps track of depth, while returning the results through the Crossings parameter.

Definition at line 245 of file path-intersection.cpp.

References Geom::Curve::boundsLocal(), c, intersect_polish_root(), Geom::GenericOptRect< C >::intersects(), linear_intersect(), pair_intersect(), and Geom::Curve::pointAt().

◆ pair_intersect() [2/2]

Crossings Geom::pair_intersect ( Curve const &  A,
Interval const &  Ad,
Curve const &  B,
Interval const &  Bd 
)

◆ parse_coord()

Coord Geom::parse_coord ( std::string const &  s)

Definition at line 101 of file coord.cpp.

Referenced by TEST(), and TEST().

◆ partial_derivative()

SBasis2d Geom::partial_derivative ( SBasis2d const &  a,
int  dim 
)

Definition at line 73 of file sbasis-2d.cpp.

References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.

Referenced by sb2d_cubic_solve(), and sb2dsolve().

◆ parting_point()

PathIntersection Geom::parting_point ( Path const &  first,
Path const &  second,
Coord  precision = EPSILON 
)

Find the first point where two paths diverge away from one another.

If the two paths have a common starting point, the algorithm follows them for as long as the images of the paths coincide and finds the first point where they stop coinciding. Note that only the images of paths in the plane are compared, and not their parametrizations, so this is not a functional (parametric) coincidence. If you want to test parametric coincidence, use bool are_near(Path const&, Path const&, Coord) instead.

The function returns the point where the traces of the two paths finally diverge up to the specified precision. If the traces (images) of the paths are nearly identical until the end, the returned point is their (almost) common endpoint. If however the image of one of the paths is completely contained in the image of the other path, the returned point is the endpoint of the shorter path.

If the paths have different starting points, then the returned intersection has the special time values of -1.0 on both paths and the returned intersection point is the midpoint of the line segment connecting the two starting points.

Parameters
firstThe first path to follow; corresponds to .first in the return value.
secondThe second path to follow; corresponds to .second in the return value.
precisionHow close the paths' images need to be in order to be considered as overlapping.
Returns
A path intersection specifying the point and path times where the two paths part ways.

Curve indices up until which the paths are known to overlap

Curve times on the curves with indices pos[] up until which the curves are known to overlap ahead of the nodes.

< Flag indicating which leg is stepping on the ladder

A closure to crop and compare the curve pieces ([-—] in the diagrams above).

A closure to skip degenerate curves; returns true if we reached the end.

Curve indices up until which the paths are known to overlap

Curve times on the curves with indices pos[] up until which the curves are known to overlap ahead of the nodes.

< Flag indicating which leg is stepping on the ladder

A closure to crop and compare the curve pieces ([-—] in the diagrams above).

A closure to skip degenerate curves; returns true if we reached the end.

Definition at line 40 of file parting-point.cpp.

References are_near(), Geom::Path::empty(), Geom::Path::initialPoint(), Geom::Curve::isNear(), Geom::GenericInterval< C >::max(), middle_point(), paths, Geom::Curve::pointAt(), Geom::Path::pointAt(), Geom::Curve::portion(), Geom::Path::size(), start_time, and Geom::Path::timeRange().

Referenced by Geom::PlanarGraph< EdgeLabel >::_compareAndReglue(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), and TEST_F().

◆ path_direction()

bool Geom::path_direction ( Path const &  p)

This function should only be applied to simple paths (regions), as otherwise a boolean winding direction is undefined.

It returns true for fill, false for hole. Defaults to using the sign of area when it reaches funny cases.

Definition at line 25 of file path-intersection.cpp.

References area(), centroid(), Geom::Path::empty(), and Geom::Path::toPwSb().

Referenced by Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::do_offset(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), and Inkscape::LivePathEffect::sp_get_recursive_pathvector().

◆ path_from_piecewise()

PathVector Geom::path_from_piecewise ( Geom::Piecewise< Geom::D2< Geom::SBasis > > const &  B,
double  tol,
bool  only_cubicbeziers 
)

Make a path from a d2 sbasis.

Parameters
pthe d2 Symmetric basis polynomial
Returns
a Path

If only_cubicbeziers is true, the resulting path may only contain CubicBezier curves. TODO: some of this logic should be lifted into svg-path

Definition at line 539 of file sbasis-to-bezier.cpp.

References are_near(), build_from_sbasis(), Geom::PathIteratorSink< OutputIterator >::closePath(), Geom::PathIteratorSink< OutputIterator >::flush(), Geom::PathIteratorSink< OutputIterator >::moveTo(), Geom::PathBuilder::peek(), sbasis_size(), and start.

Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), LPEToy::doEffect_path(), Inkscape::LivePathEffect::Effect::doEffect_path(), Inkscape::LivePathEffect::LPEAngleBisector::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), LPEToy::draw(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::knot_get(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::recalculate_controlpoints(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), Inkscape::LivePathEffect::PathParam::set_new_value(), SPCurve::stretch_endpoints(), Inkscape::Extension::Internal::PrintEmf::stroke(), Inkscape::Extension::Internal::PrintWmf::stroke(), and wrap_path().

◆ path_from_sbasis()

Path Geom::path_from_sbasis ( D2< SBasis > const &  B,
double  tol,
bool  only_cubicbeziers 
)

◆ path_mono_splits()

std::vector< double > Geom::path_mono_splits ( Path const &  p)

Finds all the monotonic splits for a path.

Only includes the split between curves if they switch derivative directions at that point.

Definition at line 410 of file path-intersection.cpp.

References append(), curve_mono_splits(), Geom::Path::empty(), Geom::Path::finalPoint(), Geom::Path::initialPoint(), offset_doubles(), Geom::Path::size(), Geom::Path::valueAt(), X, and Y.

Referenced by paths_mono_splits().

◆ paths_mono_splits()

std::vector< std::vector< double > > Geom::paths_mono_splits ( PathVector const &  ps)

Applies path_mono_splits to multiple paths, and returns the results such that time-set i corresponds to Path i.

Definition at line 433 of file path-intersection.cpp.

References path_mono_splits().

Referenced by Geom::MonoCrosser::crossings().

◆ paths_to_pw()

◆ polish_intersections()

void Geom::polish_intersections ( std::vector< std::pair< double, double > > &  xs,
D2< SBasis > const &  A,
D2< SBasis > const &  B 
)

Definition at line 390 of file basic-intersection.cpp.

References intersect_polish_root().

◆ polish_root()

double Geom::polish_root ( Poly const &  p,
double  guess,
double  tol 
)

Definition at line 122 of file polynomial.cpp.

References derivative().

◆ poly_to_sbasis()

SBasis Geom::poly_to_sbasis ( Poly const &  p)

Changes the basis of p to be sbasis.

Parameters
pthe Monomial basis polynomial
Returns
the Symmetric basis polynomial

This algorithm is horribly slow and numerically terrible. Only for testing.

Definition at line 11 of file sbasis-poly.cpp.

References multiply(), and Geom::SBasis::normalize().

Referenced by main().

◆ portion() [1/9]

◆ portion() [2/9]

template<typename T >
D2< T > Geom::portion ( const D2< T > &  a,
Coord  f,
Coord  t 
)
inline

Definition at line 163 of file d2.h.

References portion(), X, and Y.

◆ portion() [3/9]

template<typename T >
D2< T > Geom::portion ( const D2< T > &  a,
Interval  i 
)
inline

Definition at line 169 of file d2.h.

References portion(), X, and Y.

◆ portion() [4/9]

SBasis Geom::portion ( const SBasis t,
double  from,
double  to 
)
related

Definition at line 475 of file sbasis.cpp.

◆ portion() [5/9]

SBasis Geom::portion ( const SBasis t,
Interval const &  ivl 
)
inline

◆ portion() [6/9]

template<unsigned n>
SBasisN< n > Geom::portion ( const SBasisN< n > &  t,
double  from,
double  to 
)
inline

Returns the sbasis on domain [0,1] that was t on [from, to].

Parameters
asbasis function
from,tointerval
Returns
sbasis

Definition at line 1066 of file sbasisN.h.

References compose().

◆ portion() [7/9]

template<typename T >
SBasisOf< T > Geom::portion ( const SBasisOf< T > &  t,
double  from,
double  to 
)
inline

Definition at line 602 of file sbasis-of.h.

References compose().

◆ portion() [8/9]

template<typename T >
T Geom::portion ( const T &  t,
const Interval i 
)
inline

◆ portion() [9/9]

Linear Geom::portion ( Linear const &  a,
Coord  from,
Coord  to 
)
inline

Definition at line 149 of file linear.h.

References result, and Geom::Linear::valueAt().

◆ projection() [1/2]

LineSegment Geom::projection ( LineSegment const &  seg,
Line const &  line 
)
inline

◆ projection() [2/2]

◆ prolongateByConstants()

static void Geom::prolongateByConstants ( Piecewise< SBasis > &  f,
double  paddle_width 
)
static

◆ pw_compose_inverse()

Piecewise< SBasis > Geom::pw_compose_inverse ( SBasis const &  f,
SBasis const &  g,
unsigned  order,
double  zero 
)
related

◆ randpts()

auto Geom::randpts ( )

Definition at line 35 of file min-bbox-test.cpp.

Referenced by TEST().

◆ reciprocal() [1/5]

SBasis Geom::reciprocal ( Linear const &  a,
int  k 
)

Compute the recpirocal of a.

Parameters
asbasis functions
Returns
sbasis 1/a

It is recommended to use the piecewise version unless you have good reason.

Definition at line 402 of file sbasis.cpp.

References c, Geom::Linear::isZero(), and Geom::Linear::tri().

◆ reciprocal() [2/5]

SBasis2d Geom::reciprocal ( Linear2d const &  a,
int  k 
)

◆ reciprocal() [3/5]

template<unsigned n>
SBasisN< n > Geom::reciprocal ( LinearN< n > const &  a,
int  k 
)

◆ reciprocal() [4/5]

Piecewise< SBasis > Geom::reciprocal ( Piecewise< SBasis >const &  f,
double  tol = 1e-3,
int  order = 3 
)

Definition at line 335 of file sbasis-math.cpp.

References bounds_fast(), compose(), order, reciprocalOnDomain(), result, and truncateResult().

◆ reciprocal() [5/5]

Piecewise< SBasis > Geom::reciprocal ( SBasis const &  f,
double  tol = 1e-3,
int  order = 3 
)

Definition at line 329 of file sbasis-math.cpp.

References bounds_fast(), compose(), order, reciprocalOnDomain(), result, and truncateResult().

◆ reciprocalOnDomain()

◆ rect_line_intersect() [1/3]

std::vector< Geom::Point > Geom::rect_line_intersect ( Geom::Point const &  c0,
Geom::Point const &  c1,
Geom::Point const &  p0,
Geom::Point const &  p1 
)

Determine whether & where an (infinite) line intersects a rectangle.

c0, c1 are diagonal corners of the rectangle and p1, p1 are distinct points on the line

Returns
A list (possibly empty) of points of intersection. If two such points (say r0 and r1) then it is guaranteed that the order of r0, r1 along the line is the same as the that of c0, c1 (i.e., the vectors r1 - r0 and p1 - p0 point into the same direction).

Definition at line 280 of file geom.cpp.

References D, dot(), eliminate_duplicates_p(), intersects, line_segment_intersect(), X, and Y.

◆ rect_line_intersect() [2/3]

std::optional< LineSegment > Geom::rect_line_intersect ( Geom::Rect r,
Geom::Line  l 
)

Definition at line 346 of file geom.cpp.

References rect_line_intersect(), and Geom::Line::segment().

◆ rect_line_intersect() [3/3]

std::optional< LineSegment > Geom::rect_line_intersect ( Geom::Rect r,
Geom::LineSegment  ls 
)

Determine whether & where an (infinite) line intersects a rectangle.

c0, c1 are diagonal corners of the rectangle and p1, p1 are distinct points on the line

Returns
A list (possibly empty) of points of intersection. If two such points (say r0 and r1) then it is guaranteed that the order of r0, r1 along the line is the same as the that of c0, c1 (i.e., the vectors r1 - r0 and p1 - p0 point into the same direction).

Definition at line 333 of file geom.cpp.

References Geom::GenericRect< C >::max(), Geom::GenericRect< C >::min(), and rect_line_intersect().

Referenced by draw_line_in_rect(), fill_line_in_rect(), rect_line_intersect(), rect_line_intersect(), and tighten().

◆ recursively_intersect()

void Geom::recursively_intersect ( OldBezier  a,
double  t0,
double  t1,
int  deptha,
OldBezier  b,
double  u0,
double  u1,
int  depthb,
std::vector< std::pair< double, double > > &  parameters 
)

◆ rel_error_bound()

bool Geom::rel_error_bound ( Coord  a,
Coord  b,
double  eps = EPSILON 
)
inline

Definition at line 93 of file coord.h.

Referenced by Geom::Affine::inverse().

◆ reparameterize()

static void Geom::reparameterize ( Point const  d[],
unsigned const  len,
double  u[],
Point const  bezCurve[] 
)
static

Given set of points and their parameterization, try to find a better assignment of parameter values for the points.

Parameters
dArray of digitized points.
uCurrent parameter values.
bezCurveCurrent fitted curve.
lenNumber of values in both d and u arrays. Also the size of the array that is allocated for return.

Definition at line 538 of file bezier-utils.cpp.

References len, and NewtonRaphsonRootFind().

Referenced by bezier_fit_cubic_full().

◆ rescale_homogenous()

template<size_t N>
int Geom::rescale_homogenous ( std::array< double, N > &  values)
inline

Scale the doubles in the passed array to make them "reasonably large".

All doubles in the passed array will get scaled by the same power of 2 (which is a lossless operation) in such a way that their geometric average gets closer to 1.

Template Parameters
NThe size of the passed array.
Parameters
[in,out]valuesThe doubles to be rescaled in place.
Returns
The exponent in the power of two by which the doubles got scaled.

Definition at line 108 of file math-utils.h.

References N.

Referenced by Geom::xAx::decompose_df(), Geom::Ellipse::intersect(), and Geom::Ellipse::intersect().

◆ reverse() [1/5]

◆ reverse() [2/5]

template<typename T >
D2< T > Geom::reverse ( const D2< T > &  a)
inline

Definition at line 157 of file d2.h.

References reverse(), X, and Y.

◆ reverse() [3/5]

Linear Geom::reverse ( Linear const &  a)
inline

Definition at line 148 of file linear.h.

◆ reverse() [4/5]

template<typename T >
LinearOf< T > Geom::reverse ( LinearOf< T > const &  a)
inline

Definition at line 145 of file linear-of.h.

◆ reverse() [5/5]

template<typename T >
SBasisOf< T > Geom::reverse ( SBasisOf< T > const &  a)
inline

Definition at line 189 of file sbasis-of.h.

References result, and reverse().

◆ reverse_ta() [1/2]

Crossings Geom::reverse_ta ( Crossings const &  cr,
std::vector< double >  max 
)

Definition at line 143 of file crossing.cpp.

References max().

Referenced by reverse_ta().

◆ reverse_ta() [2/2]

CrossingSet Geom::reverse_ta ( CrossingSet const &  cr,
unsigned  split,
std::vector< double >  max 
)

Definition at line 163 of file crossing.cpp.

References max(), reverse_ta(), and split().

◆ reverse_tb() [1/2]

Crossings Geom::reverse_tb ( Crossings const &  cr,
unsigned  split,
std::vector< double >  max 
)

Definition at line 153 of file crossing.cpp.

References max(), and split().

Referenced by reverse_tb().

◆ reverse_tb() [2/2]

CrossingSet Geom::reverse_tb ( CrossingSet const &  cr,
unsigned  split,
std::vector< double >  max 
)

Definition at line 173 of file crossing.cpp.

References max(), reverse_tb(), and split().

◆ roots() [1/4]

std::vector< double > Geom::roots ( Piecewise< SBasis > const &  f)

◆ roots() [2/4]

◆ roots() [3/4]

std::vector< double > Geom::roots ( SBasis const &  s,
Interval const  inside 
)

◆ roots() [4/4]

template<unsigned n>
std::vector< double > Geom::roots ( SBasisN< n > const &  s)

◆ rot90() [1/2]

template<typename T >
D2< T > Geom::rot90 ( D2< T > const &  a)
inline

Definition at line 397 of file d2.h.

References X, and Y.

Referenced by Inkscape::UI::Tools::EraserTool::_addCap(), Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Dialog::GuidelinePropertiesDialog::_onOKimpl(), Inkscape::CanvasItemGuideLine::_render(), Inkscape::ObjectSnapper::_snapTranslatingGuide(), Inkscape::UI::Tools::add_cap(), Inkscape::UI::Tools::CalligraphicTool::apply(), Geom::Piecewise< T >::centroid(), Inkscape::CanvasItemGuideLine::closest_distance_to(), Inkscape::LineSnapper::constrainedSnap(), SPGuide::createSPGuide(), cubic_length_subdividing(), curvature(), darray_center_tangent(), Geom::BezierFitter::darray_center_tangent(), decompose_degenerate(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), doEffect_pwd2(), dot_plot(), dot_plot(), Inkscape::UI::Handle::dragged(), Inkscape::UI::Node::dragged(), draw_line(), draw_ray(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Geom::D2< T >::find_tangents_by_vector(), Inkscape::LineSnapper::freeSnap(), Geom::Line::from_normal_distance(), Inkscape::SnappedLine::getLine(), Inkscape::GridSnapper::getSnapLinesAxonom(), goal_function(), SnapManager::guideConstrainedSnap(), SnapManager::guideFreeSnap(), intersector_ccw(), line_best_fit(), line_intersection(), Geom::Line::normal(), Geom::detail::bezier_clipping::normal(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), plot_offset(), rot90(), Inkscape::SelTrans::rotateRequest(), Inkscape::UI::Widget::ruler_snap_new_guide(), sb2d_cubic_solve(), sbofsb_cubic_solve(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), Inkscape::PureRotateConstrained::storeTransform(), Inkscape::LivePathEffect::stretch_along(), Geom::xAx::toCurve(), Geom::xAx::toRatQuad(), and vectors_are_clockwise().

◆ rot90() [2/2]

Piecewise< D2< SBasis > > Geom::rot90 ( Piecewise< D2< SBasis > > const &  a)

Definition at line 85 of file d2-sbasis.cpp.

References Geom::Piecewise< T >::push_cut(), result, and rot90().

◆ same_side()

bool Geom::same_side ( Point  L[2],
Point  xs[4] 
)

Definition at line 526 of file convex-hull.cpp.

References sgn(), and SignedTriangleArea().

Referenced by bridges().

◆ sb2d_cubic_solve()

D2< SBasis > Geom::sb2d_cubic_solve ( SBasis2d const &  f,
Geom::Point const &  A,
Geom::Point const &  B 
)

Finds a path which traces the 0 contour of f, traversing from A to B as a single cubic d2<sbasis>.

The algorithm is based on matching direction and curvature at each end point.

Definition at line 147 of file sbasis-2d.cpp.

References Geom::SBasis2d::apply(), bounds, bounds_fast(), compose(), cubics_fitting_curvature(), Geom::GenericRect< C >::max(), Geom::GenericRect< C >::min(), partial_derivative(), result, rot90(), X, and Y.

◆ sb2dsolve()

D2< SBasis > Geom::sb2dsolve ( SBasis2d const &  f,
Geom::Point const &  A,
Geom::Point const &  B,
unsigned  degmax 
)

Finds a path which traces the 0 contour of f, traversing from A to B as a single d2<sbasis>.

degmax specifies the degree (degree = 2*degmax-1, so a degmax of 2 generates a cubic fit). The algorithm is based on dividing out derivatives at each end point and does not use the curvature for fitting. It is less accurate than sb2d_cubic_solve, although this may be fixed in the future.

Definition at line 107 of file sbasis-2d.cpp.

References Geom::SBasis2d::apply(), compose(), partial_derivative(), result, sign(), X, and Y.

◆ sbasis_size()

unsigned Geom::sbasis_size ( D2< SBasis > const &  a)

Definition at line 56 of file d2-sbasis.cpp.

References size.

Referenced by build_from_sbasis(), and path_from_piecewise().

◆ sbasis_to_bezier() [1/5]

void Geom::sbasis_to_bezier ( Bezier bz,
SBasis const &  sb,
size_t  sz 
)

Changes the basis of p to be bernstein.

Parameters
pthe Symmetric basis polynomial
Returns
the Bernstein basis polynomial

if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order sz is the number of bezier handles.

Definition at line 86 of file sbasis-to-bezier.cpp.

References binomial_increment_k(), Geom::Bezier::clear(), Geom::Bezier::resize(), and Geom::SBasis::size().

Referenced by Geom::Curve::feed(), find_intersections(), find_self_intersections(), hausdorfl(), main(), sbasis_to_bezier(), sbasis_to_bezier(), sbasis_to_cubic_bezier(), sbasis_to_cubicbezier(), sbasis_to_returned_bezier(), TEST_F(), and TEST_F().

◆ sbasis_to_bezier() [2/5]

void Geom::sbasis_to_bezier ( D2< Bezier > &  bz,
D2< SBasis > const &  sb,
size_t  sz = 0 
)

Definition at line 143 of file sbasis-to-bezier.cpp.

References sbasis_to_bezier(), size, X, and Y.

◆ sbasis_to_bezier() [3/5]

std::vector< Geom::Point > Geom::sbasis_to_bezier ( D2< SBasis > const &  B,
unsigned  q = 0 
)

◆ sbasis_to_bezier() [4/5]

Bezier Geom::sbasis_to_bezier ( SBasis const &  B,
unsigned  q = 0 
)

◆ sbasis_to_bezier() [5/5]

void Geom::sbasis_to_bezier ( std::vector< Point > &  bz,
D2< SBasis > const &  sb,
size_t  sz 
)

Changes the basis of p to be Bernstein.

Parameters
pthe D2 Symmetric basis polynomial
Returns
the D2 Bernstein basis polynomial

sz is always the polynomial degree, i. e. the Bezier order

Definition at line 158 of file sbasis-to-bezier.cpp.

References bezier_points(), and sbasis_to_bezier().

◆ sbasis_to_cubic_bezier()

void Geom::sbasis_to_cubic_bezier ( std::vector< Point > &  bz,
D2< SBasis > const &  sb 
)

Changes the basis of p to be Bernstein.

Parameters
pthe D2 Symmetric basis polynomial
Returns
the D2 Bernstein basis cubic polynomial

Bezier is always cubic. For general asymmetric case, fit the SBasis function value at midpoint For parallel, symmetric case, find the point of closest approach to the midpoint For parallel, anti-symmetric case, fit the SBasis slope at midpoint

Definition at line 174 of file sbasis-to-bezier.cpp.

References Geom::ConvexHull::contains(), EPSILON, sbasis_to_bezier(), size, test1, test2, X, and Y.

Referenced by build_from_sbasis(), and TEST_F().

◆ sbasis_to_cubicbezier()

static Geom::CubicBezier Geom::sbasis_to_cubicbezier ( Geom::D2< Geom::SBasis > const &  sbasis_in)
static

◆ sbasis_to_poly()

Poly Geom::sbasis_to_poly ( SBasis const &  sb)

Changes the basis of p to be monomial.

Parameters
pthe Symmetric basis polynomial
Returns
the Monomial basis polynomial

This algorithm is horribly slow and numerically terrible. Only for testing.

Definition at line 29 of file sbasis-poly.cpp.

References Geom::SBasis::isZero(), Geom::Poly::normalize(), and Geom::SBasis::size().

Referenced by intersect(), main(), and make_implicit_curve().

◆ sectionize()

◆ segment_intersect()

IntersectorKind Geom::segment_intersect ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11,
Geom::Point result 
)

Determine whether & where two line segments intersect.

If the two segments don't intersect, then result remains unchanged.

Precondition
neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 188 of file geom.cpp.

References dot(), line_intersection(), n1, no_intersection, result, and segment_intersectp().

◆ segment_intersectp()

bool Geom::segment_intersectp ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11 
)

Determine whether two line segments intersect.

This doesn't find the point of intersection, use the line_intersect function above, or the segment_intersection interface below.

Precondition
neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 145 of file geom.cpp.

References line_segment_intersectp().

Referenced by segment_intersect().

◆ self_crossings()

Crossings Geom::self_crossings ( Path const &  a)

◆ set_first_point()

static void Geom::set_first_point ( Piecewise< D2< SBasis > > &  f,
Point const &  a 
)
static

Definition at line 235 of file d2-sbasis.cpp.

References X, and Y.

Referenced by fuse_nearby_ends().

◆ set_last_point()

static void Geom::set_last_point ( Piecewise< D2< SBasis > > &  f,
Point const &  a 
)
static

Definition at line 244 of file d2-sbasis.cpp.

References X, and Y.

Referenced by fuse_nearby_ends().

◆ setToVariable()

template<unsigned n>
void Geom::setToVariable ( LinearN< n > &  x,
unsigned  k 
)

Definition at line 333 of file linearN.h.

◆ sgn() [1/2]

◆ sgn() [2/2]

int Geom::sgn ( double  x)

Definition at line 521 of file convex-hull.cpp.

◆ shift() [1/9]

SBasis Geom::shift ( Linear const &  a,
int  sh 
)

multiply a by x^sh (Exact)

Parameters
alinear function
shpower
Returns
a* x^sh

Definition at line 216 of file sbasis.cpp.

References c.

◆ shift() [2/9]

SBasis2d Geom::shift ( Linear2d const &  a,
int  sh 
)

◆ shift() [3/9]

template<unsigned n>
SBasisN< n > Geom::shift ( LinearN< n > const &  a,
MultiDegree< n >  sh 
)

Definition at line 831 of file sbasisN.h.

References Geom::MultiDegree< n >::asIdx(), result, and Geom::SBasisN< n >::sizes.

◆ shift() [4/9]

template<unsigned n>
SBasisN< n > Geom::shift ( LinearN< n > const &  a,
unsigned  sh,
unsigned  var 
)

Definition at line 843 of file sbasisN.h.

References result, and Geom::SBasisN< n >::sizes.

◆ shift() [5/9]

template<typename T >
SBasisOf< T > Geom::shift ( LinearOf< T > const &  a,
int  sh 
)

Definition at line 446 of file sbasis-of.h.

References c.

◆ shift() [6/9]

SBasis Geom::shift ( SBasis const &  a,
int  sh 
)

multiply a by x^sh in place (Exact)

Parameters
asbasis function
shpower
Returns
a

Definition at line 198 of file sbasis.cpp.

References c, and Geom::SBasis::size().

◆ shift() [7/9]

SBasis2d Geom::shift ( SBasis2d const &  a,
int  sh 
)

◆ shift() [8/9]

template<unsigned n>
SBasisN< n > Geom::shift ( SBasisN< n > const &  a,
MultiDegree< n >  sh 
)

◆ shift() [9/9]

template<typename T >
SBasisOf< T > Geom::shift ( SBasisOf< T > const &  a,
int  sh 
)

◆ sign()

◆ signed_triangle_area()

double Geom::signed_triangle_area ( Point const &  p1,
Point const &  p2,
Point const &  p3 
)
inline

Definition at line 206 of file conic_section_clipper_impl.cpp.

References cross().

Referenced by Geom::xAx::arc_bound(), and Geom::CLIPPER_CLASS::are_paired().

◆ SignedTriangleArea()

double Geom::SignedTriangleArea ( Point  p0,
Point  p1,
Point  p2 
)

Definition at line 354 of file convex-hull.cpp.

References cross().

Referenced by same_side().

◆ signSb() [1/2]

Piecewise< SBasis > Geom::signSb ( Piecewise< SBasis > const &  f)

Return the sign of the two functions pointwise.

Parameters
ffunction

Definition at line 129 of file sbasis-math.cpp.

References roots(), and sign().

◆ signSb() [2/2]

Piecewise< SBasis > Geom::signSb ( SBasis const &  f)

Return the sign of the two functions pointwise.

Parameters
ffunction

Definition at line 123 of file sbasis-math.cpp.

References signSb().

Referenced by signSb().

◆ sin() [1/4]

SBasis Geom::sin ( Linear  b,
int  k 
)

Compute the sine of a to k terms.

Parameters
blinear function
Returns
sbasis sin(a)

It is recommended to use the piecewise version unless you have good reason.

Definition at line 583 of file sbasis.cpp.

References Geom::Linear::tri().

◆ sin() [2/4]

◆ sin() [3/4]

Piecewise< SBasis > Geom::sin ( Piecewise< SBasis > const &  f,
double  tol,
int  order 
)

Compute the sine of a function.

Parameters
ffunction
tolmaximum error
ordermaximum degree polynomial to use

Definition at line 215 of file sbasis-math.cpp.

References cos(), and order.

◆ sin() [4/4]

Piecewise< SBasis > Geom::sin ( SBasis const &  f,
double  tol,
int  order 
)

Compute the sine of a function.

Parameters
ffunction
tolmaximum error
ordermaximum degree polynomial to use

Definition at line 209 of file sbasis-math.cpp.

References cos(), and order.

◆ sincos()

void Geom::sincos ( double  angle,
double &  sin_,
double &  cos_ 
)
inline

Simultaneously compute a sine and a cosine of the same angle.

This function can be up to 2 times faster than separate computation, depending on the platform. It uses the standard library function sincos() if available.

Parameters
angleAngle
sin_Variable that will store the sine
cos_Variable that will store the cosine

Definition at line 89 of file math-utils.h.

References cos(), sin(), and sincos().

Referenced by Inkscape::UI::Widget::OKWheel::_curColorWheelCoords(), Geom::EllipticalArc::allNearestTimes(), Geom::Ellipse::coefficients(), Geom::Ellipse::initialPoint(), Geom::Line::Line(), Geom::Point::polar(), Geom::Ray::Ray(), Geom::EllipticalArc::roots(), Geom::Ray::setAngle(), Geom::Line::setAngle(), Geom::Ellipse::setCoefficients(), sincos(), Inkscape::Colors::Space::Lch::toLuv(), Inkscape::Colors::Space::OkHsl::toOkLab(), Inkscape::Colors::Space::OkLch::toOkLab(), Geom::EllipticalArc::toSBasis(), Inkscape::UI::Tools::unsnapped_polar(), Geom::Ellipse::valueAt(), and Geom::EllipticalArc::winding().

◆ smash_intersect()

std::vector< SmashIntersection > Geom::smash_intersect ( D2< SBasis > const &  a,
D2< SBasis > const &  b,
double  tol 
)

◆ solve() [1/2]

std::vector< std::complex< double > > Geom::solve ( const Poly p)

Definition at line 84 of file polynomial.cpp.

References Geom::Poly::degree(), Geom::Poly::normalize(), roots(), and w.

Referenced by Geom::xAx::bottom(), main(), and solve_reals().

◆ solve() [2/2]

std::optional< Point > Geom::solve ( double  A[2][2],
double  b[2] 
)

Definition at line 628 of file conicsec.cpp.

References det().

◆ solve_cubic()

std::vector< Coord > Geom::solve_cubic ( Coord  a,
Coord  b,
Coord  c,
Coord  d 
)

Analytically solve cubic equation.

The equation is given in the standard form: ax^3 + bx^2 + cx + d = 0. Only real roots are returned.

Definition at line 260 of file polynomial.cpp.

References c, cbrt, cos(), D, R, result, solve_quadratic(), and sqrt().

Referenced by bezier_line_intersections(), Geom::Ellipse::intersect(), Inkscape::Colors::Space::OkLch::max_chroma(), solve_quartic(), TEST(), and TEST().

◆ solve_quadratic()

std::vector< Coord > Geom::solve_quadratic ( Coord  a,
Coord  b,
Coord  c 
)

Analytically solve quadratic equation.

The equation is given in the standard form: ax^2 + bx + c = 0. Only real roots are returned.

Definition at line 226 of file polynomial.cpp.

References c, delta, result, sign(), and sqrt().

Referenced by bezier_line_intersections(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Geom::Ellipse::intersect(), solve_cubic(), solve_quartic(), TEST(), TEST(), and TEST().

◆ solve_quartic()

std::vector< Coord > Geom::solve_quartic ( Coord  a,
Coord  b,
Coord  c,
Coord  d,
Coord  e 
)

Analytically solve quartic equation.

The equation is given in the standard form: ax^4 + bx^3 + cx^2 + dx + e = 0. Only real roots are returned.

Definition at line 318 of file polynomial.cpp.

References c, result, solve_cubic(), solve_quadratic(), and sqr().

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ solve_reals()

std::vector< double > Geom::solve_reals ( const Poly p)

Definition at line 110 of file polynomial.cpp.

References root, roots(), and solve().

Referenced by Geom::EllipticalArc::allNearestTimes(), and intersect().

◆ sort_crossings()

void Geom::sort_crossings ( Crossings cr,
unsigned  ix 
)
inline

Definition at line 144 of file crossing.h.

Referenced by Geom::Crosser< T >::crossings(), and merge_crossings().

◆ split()

void Geom::split ( vector< Point > const &  p,
double  t,
vector< Point > &  left,
vector< Point > &  right 
)

◆ split_at_discontinuities()

◆ split_bounds()

std::vector< std::vector< Rect > > Geom::split_bounds ( PathVector const &  p,
std::vector< std::vector< double > >  splits 
)

Processes the bounds for a list of paths and a list of splits on them, yielding a list of rects for each.

Each entry i corresponds to path i of the input. The number of rects in each entry is guaranteed to be the number of splits for that path, subtracted by one.

Definition at line 445 of file path-intersection.cpp.

References Geom::PathVector::pointAt(), and Geom::PathVector::size().

Referenced by Geom::MonoCrosser::crossings().

◆ sqr()

◆ sqrt() [1/5]

Piecewise< SBasis > Geom::sqrt ( Piecewise< SBasis > const &  f,
double  tol,
int  order 
)

◆ sqrt() [2/5]

SBasis Geom::sqrt ( SBasis const &  a,
int  k 
)

Compute the sqrt of a.

Parameters
asbasis functions
Returns
sbasis

\[ \sqrt{a} \]

It is recommended to use the piecewise version unless you have good reason. TODO: convert int k to unsigned k, and remove cast

Definition at line 375 of file sbasis.cpp.

References c, Geom::SBasis::isZero(), multiply(), Geom::SBasis::resize(), shift(), Geom::SBasis::size(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().

◆ sqrt() [3/5]

Piecewise< SBasis > Geom::sqrt ( SBasis const &  f,
double  tol,
int  order 
)

Compute the sqrt of a function.

Parameters
ffunction

Definition at line 181 of file sbasis-math.cpp.

References max(), order, and sqrt().

◆ sqrt() [4/5]

SBasis2d Geom::sqrt ( SBasis2d const &  a,
int  k 
)

◆ sqrt() [5/5]

◆ sqrt_internal()

◆ stringify()

template<typename T >
std::string Geom::stringify ( x)
inline

Definition at line 92 of file conicsec.cpp.

Referenced by Geom::xAx::categorise().

◆ structured_binding_test()

template<typename IntervalType >
constexpr bool Geom::structured_binding_test ( )
constexpr

Definition at line 60 of file interval-test.cpp.

References X, and Y.

◆ subdiv_sbasis()

void Geom::subdiv_sbasis ( SBasis const &  s,
std::vector< double > &  roots,
double  left,
double  right 
)
extern

◆ subdivide()

void Geom::subdivide ( D2< Bezier > const &  a,
D2< Bezier > const &  b,
std::vector< std::pair< double, double > > const &  xs,
std::vector< D2< Bezier > > &  av,
std::vector< D2< Bezier > > &  bv 
)

Definition at line 202 of file basic-intersection.cpp.

References lerp(), portion(), X, and Y.

◆ sweep_bounds() [1/2]

std::vector< std::vector< unsigned > > Geom::sweep_bounds ( std::vector< Rect a,
std::vector< Rect b,
Dim2  d 
)

Make a list of pairs of red-blue intersections between two lists of Rects.

Parameters
avector of Rect.
bvector of Rect.
ddimension to scan along

[(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J] then A.left <= B.left, A in a, B in b

Definition at line 74 of file sweep-bounds.cpp.

References end, intersects, max(), min(), and size.

◆ sweep_bounds() [2/2]

std::vector< std::vector< unsigned > > Geom::sweep_bounds ( std::vector< Rect rs,
Dim2  d 
)

Make a list of pairs of self intersections in a list of Rects.

Parameters
rsvector of Rect.
ddimension to sweep along

[(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J] then A.left <= B.left

Definition at line 35 of file sweep-bounds.cpp.

References intersects, max(), min(), and rs.

Referenced by Geom::MonoCrosser::crossings(), Geom::Crosser< T >::crossings(), crossings_among(), curve_sweep(), draw_bounds(), and self_crossings().

◆ sweepline_intersection()

ConvexHull Geom::sweepline_intersection ( ConvexHull const &  a,
ConvexHull const &  b 
)

Definition at line 607 of file convex-hull.cpp.

References Geom::ConvexHull::size(), and Y.

◆ tail_error()

double Geom::tail_error ( D2< SBasis > const &  a,
unsigned  tail 
)

Definition at line 61 of file d2-sbasis.cpp.

Referenced by build_from_sbasis().

◆ tan2() [1/2]

D2< Piecewise< SBasis > > Geom::tan2 ( Piecewise< SBasis > const &  angle,
double  tol = .01,
unsigned  order = 3 
)
related

◆ tan2() [2/2]

D2< Piecewise< SBasis > > Geom::tan2 ( SBasis const &  angle,
double  tol = .01,
unsigned  order = 3 
)
related

◆ TEST() [1/34]

◆ TEST() [2/34]

Geom::TEST ( AffineTest  ,
CoordinateAccess   
)

Definition at line 390 of file affine-test.cpp.

◆ TEST() [3/34]

Geom::TEST ( AffineTest  ,
Equality   
)

Definition at line 40 of file affine-test.cpp.

References Geom::Affine::identity(), and identity().

◆ TEST() [4/34]

Geom::TEST ( AffineTest  ,
Inversion   
)

Definition at line 380 of file affine-test.cpp.

References Geom::Affine::inverse().

◆ TEST() [5/34]

Geom::TEST ( AffineTest  ,
Multiplication   
)

Definition at line 410 of file affine-test.cpp.

◆ TEST() [6/34]

Geom::TEST ( AffineTest  ,
Nearness   
)

Definition at line 403 of file affine-test.cpp.

References are_near().

◆ TEST() [7/34]

Geom::TEST ( CoordTest  ,
StringRoundtripNice   
)

Definition at line 61 of file coord-test.cpp.

References format_coord_nice(), and parse_coord().

◆ TEST() [8/34]

Geom::TEST ( CoordTest  ,
StringRoundtripShortest   
)

Definition at line 43 of file coord-test.cpp.

References format_coord_shortest(), and parse_coord().

◆ TEST() [9/34]

Geom::TEST ( IntervalTest  ,
EqualityTest   
)

Definition at line 53 of file interval-test.cpp.

◆ TEST() [10/34]

Geom::TEST ( IntervalTest  ,
Hash   
)

Definition at line 90 of file interval-test.cpp.

References test().

◆ TEST() [11/34]

Geom::TEST ( IntervalTest  ,
StructuredBindingTest   
)

Definition at line 84 of file interval-test.cpp.

◆ TEST() [12/34]

Geom::TEST ( MinBBoxTest  ,
Empty   
)

Definition at line 47 of file min-bbox-test.cpp.

◆ TEST() [13/34]

Geom::TEST ( MinBBoxTest  ,
Randomised   
)

Definition at line 61 of file min-bbox-test.cpp.

References aligned_bbox(), approx_min(), and randpts().

◆ TEST() [14/34]

Geom::TEST ( MinBBoxTest  ,
SinglePoint   
)

Definition at line 54 of file min-bbox-test.cpp.

References Geom::GenericRect< Coord >::from_xywh().

◆ TEST() [15/34]

Geom::TEST ( PointTest  ,
Hash   
)

Definition at line 141 of file point-test.cpp.

References test().

◆ TEST() [16/34]

Geom::TEST ( PointTest  ,
IntPointCtors   
)

Definition at line 100 of file point-test.cpp.

References X, and Y.

◆ TEST() [17/34]

Geom::TEST ( PointTest  ,
Multiplicative   
)

Definition at line 79 of file point-test.cpp.

◆ TEST() [18/34]

Geom::TEST ( PointTest  ,
Near   
)

Definition at line 71 of file point-test.cpp.

References are_near(), and are_near_rel().

◆ TEST() [19/34]

Geom::TEST ( PointTest  ,
Normalize   
)

Definition at line 41 of file point-test.cpp.

References Geom::Point::normalize(), and Geom::Point::normalized().

◆ TEST() [20/34]

Geom::TEST ( PointTest  ,
PointCtors   
)

Definition at line 86 of file point-test.cpp.

References X, and Y.

◆ TEST() [21/34]

Geom::TEST ( PointTest  ,
Rounding   
)

Definition at line 63 of file point-test.cpp.

References Geom::Point::ceil(), Geom::Point::floor(), and Geom::Point::round().

◆ TEST() [22/34]

Geom::TEST ( PointTest  ,
ScalarOps   
)

Definition at line 51 of file point-test.cpp.

◆ TEST() [23/34]

Geom::TEST ( RectTest  ,
Expanded   
)

Definition at line 87 of file rect-test.cpp.

References expandedBy().

◆ TEST() [24/34]

Geom::TEST ( RectTest  ,
ExpansionInPlace   
)

Definition at line 76 of file rect-test.cpp.

References Geom::GenericRect< C >::expandBy().

◆ TEST() [25/34]

Geom::TEST ( RectTest  ,
Rounding   
)

Definition at line 61 of file rect-test.cpp.

References Geom::Rect::roundInwards(), and Geom::Rect::roundOutwards().

◆ TEST() [26/34]

Geom::TEST ( RectTest  ,
ShrinkingInPlace   
)

Definition at line 92 of file rect-test.cpp.

References Geom::GenericRect< C >::shrinkBy().

◆ TEST() [27/34]

Geom::TEST ( RectTest  ,
Shrunk   
)

Definition at line 103 of file rect-test.cpp.

◆ TEST() [28/34]

Geom::TEST ( RectTest  ,
Upconversion   
)

Definition at line 42 of file rect-test.cpp.

◆ TEST() [29/34]

Geom::TEST ( Vector  ,
IsPositive   
)

Definition at line 157 of file nl-vector-test.cpp.

References V3().

◆ TEST() [30/34]

Geom::TEST ( Vector  ,
Max   
)

Definition at line 174 of file nl-vector-test.cpp.

References max(), and V3().

◆ TEST() [31/34]

Geom::TEST ( Vector  ,
MaxIndex   
)

Definition at line 178 of file nl-vector-test.cpp.

References V3().

◆ TEST() [32/34]

Geom::TEST ( Vector  ,
Min   
)

Definition at line 182 of file nl-vector-test.cpp.

References min(), and V3().

◆ TEST() [33/34]

Geom::TEST ( Vector  ,
MinIndex   
)

Definition at line 186 of file nl-vector-test.cpp.

References V3().

◆ TEST() [34/34]

Geom::TEST ( Vector  ,
SwappingVectors   
)

Definition at line 200 of file nl-vector-test.cpp.

References Geom::NL::swap(), and V3().

◆ TEST_F() [1/33]

Geom::TEST_F ( VectorTest  ,
AddAssignment   
)

Definition at line 135 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [2/33]

Geom::TEST_F ( VectorTest  ,
AssignedVectorMustBeSameSize   
)

Definition at line 109 of file nl-vector-test.cpp.

◆ TEST_F() [3/33]

Geom::TEST_F ( VectorTest  ,
IsNonNegative   
)

Definition at line 168 of file nl-vector-test.cpp.

References V3().

◆ TEST_F() [4/33]

Geom::TEST_F ( VectorTest  ,
IsZero   
)

Definition at line 163 of file nl-vector-test.cpp.

References is_zero(), and V3().

◆ TEST_F() [5/33]

Geom::TEST_F ( VectorTest  ,
OperatorEqualIsDefined   
)

Definition at line 86 of file nl-vector-test.cpp.

◆ TEST_F() [6/33]

Geom::TEST_F ( VectorTest  ,
OperatorNotEqualIsntDefined   
)

Definition at line 95 of file nl-vector-test.cpp.

◆ TEST_F() [7/33]

Geom::TEST_F ( VectorTest  ,
Reverse   
)

Definition at line 152 of file nl-vector-test.cpp.

◆ TEST_F() [8/33]

Geom::TEST_F ( VectorTest  ,
ScaleAndTranslateUsesFluentSyntax   
)

◆ TEST_F() [9/33]

Geom::TEST_F ( VectorTest  ,
SetAll   
)

Definition at line 190 of file nl-vector-test.cpp.

◆ TEST_F() [10/33]

Geom::TEST_F ( VectorTest  ,
SetBasis   
)

Definition at line 195 of file nl-vector-test.cpp.

◆ TEST_F() [11/33]

Geom::TEST_F ( VectorTest  ,
SubtractAssignment   
)

Definition at line 141 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [12/33]

Geom::TEST_F ( VectorTest  ,
SwappingElements   
)

Definition at line 147 of file nl-vector-test.cpp.

◆ TEST_F() [13/33]

Geom::TEST_F ( VectorTest  ,
VectorAssignment   
)

Definition at line 102 of file nl-vector-test.cpp.

◆ TEST_F() [14/33]

Geom::TEST_F ( VectorTest  ,
VectorConstructFromAnother   
)

Definition at line 81 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [15/33]

Geom::TEST_F ( VectorTest  ,
VectorScalesInplace   
)

Definition at line 120 of file nl-vector-test.cpp.

◆ TEST_F() [16/33]

Geom::TEST_F ( VectorTest  ,
VectorStringRepresentation   
)

Definition at line 77 of file nl-vector-test.cpp.

◆ TEST_F() [17/33]

Geom::TEST_F ( VectorTest  ,
VectorTranslatesInplace   
)

Definition at line 125 of file nl-vector-test.cpp.

◆ TEST_F() [18/33]

Geom::TEST_F ( VectorViewTest  ,
AddAssignAvailableForViews   
)

Definition at line 293 of file nl-vector-test.cpp.

◆ TEST_F() [19/33]

Geom::TEST_F ( VectorViewTest  ,
AssignmentFromVectorAvailableForViews   
)

Definition at line 262 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [20/33]

Geom::TEST_F ( VectorViewTest  ,
AssignmentFromVectorMustBeSameSize   
)

Definition at line 269 of file nl-vector-test.cpp.

◆ TEST_F() [21/33]

Geom::TEST_F ( VectorViewTest  ,
AssignmentFromViewAvailableForViews   
)

Definition at line 275 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [22/33]

Geom::TEST_F ( VectorViewTest  ,
AssignmentFromViewMustBeSameSize   
)

Definition at line 284 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::size().

◆ TEST_F() [23/33]

Geom::TEST_F ( VectorViewTest  ,
ConstructFromAnotherView   
)

Definition at line 230 of file nl-vector-test.cpp.

References Geom::NL::detail::BaseVectorImpl::str().

◆ TEST_F() [24/33]

Geom::TEST_F ( VectorViewTest  ,
PartialSourceModification   
)

◆ TEST_F() [25/33]

Geom::TEST_F ( VectorViewTest  ,
SkipSomeInitialElements   
)

Definition at line 219 of file nl-vector-test.cpp.

◆ TEST_F() [26/33]

Geom::TEST_F ( VectorViewTest  ,
SparseViewConstruction   
)

Definition at line 224 of file nl-vector-test.cpp.

◆ TEST_F() [27/33]

Geom::TEST_F ( VectorViewTest  ,
SubtractAssignAvailableForViews   
)

Definition at line 299 of file nl-vector-test.cpp.

◆ TEST_F() [28/33]

Geom::TEST_F ( VectorViewTest  ,
SwappingDifferentLengthViewFails   
)

Definition at line 325 of file nl-vector-test.cpp.

References Geom::NL::swap_view().

◆ TEST_F() [29/33]

Geom::TEST_F ( VectorViewTest  ,
SwappingFromSameSourceVectorDoesNotModifySource   
)

Definition at line 307 of file nl-vector-test.cpp.

References Geom::NL::swap_view().

◆ TEST_F() [30/33]

Geom::TEST_F ( VectorViewTest  ,
SwappingFromSameSourceVectorModifiesViews   
)

◆ TEST_F() [31/33]

Geom::TEST_F ( VectorViewTest  ,
ViewCountOnly   
)

Definition at line 214 of file nl-vector-test.cpp.

◆ TEST_F() [32/33]

Geom::TEST_F ( VectorViewTest  ,
ViewScaleAndTranslateUsesFluentSyntax   
)

Definition at line 255 of file nl-vector-test.cpp.

References scale.

◆ TEST_F() [33/33]

Geom::TEST_F ( VectorViewTest  ,
ViewScalesInplace   
)

Definition at line 250 of file nl-vector-test.cpp.

◆ toLinear()

Linear Geom::toLinear ( LinearN< 1 >  f)

Definition at line 210 of file linearN.h.

Referenced by plot3d(), and toSBasis().

◆ toSBasis()

◆ touching_circle() [1/3]

static Circle Geom::touching_circle ( CubicBezier const &  curve,
bool  start 
)
static

Definition at line 69 of file geom-pathstroke.cpp.

References area(), cross(), Geom::Point::cw(), distance(), and start.

◆ touching_circle() [2/3]

static Circle Geom::touching_circle ( D2< SBasis > const &  curve,
double  t,
double  tol = 0.01 
)
static

Find circle that touches inside of the curve, with radius matching the curvature, at time value t.

Because this method internally uses unitTangentAt, t should be smaller than 1.0 (see unitTangentAt).

Definition at line 38 of file geom-pathstroke.cpp.

References are_near(), cross(), Geom::Point::cw(), derivative(), divide(), dot(), unitTangentAt(), and unitVector().

Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().

◆ touching_circle() [3/3]

static Circle Geom::touching_circle ( D2< SBasis > const &  curve,
double  t,
double  tol = 0.01 
)
static

Find circle that touches inside of the curve, with radius matching the curvature, at time value t.

Because this method internally uses unitTangentAt, t should be smaller than 1.0 (see unitTangentAt).

Definition at line 93 of file lpe-powerstroke.cpp.

References are_near(), cross(), Geom::Point::cw(), derivative(), divide(), dot(), Geom::Piecewise< T >::empty(), Geom::D2< T >::isZero(), size, unitTangentAt(), and unitVector().

◆ transpose()

template<typename A , typename B >
std::vector< Intersection< A, B > > Geom::transpose ( std::vector< Intersection< B, A > > const &  in)
inline

Definition at line 117 of file intersection.h.

References result.

◆ transpose_in_place()

template<typename T >
void Geom::transpose_in_place ( std::vector< Intersection< T, T > > &  xs)
inline

◆ truncate() [1/5]

D2< SBasis > Geom::truncate ( D2< SBasis > const &  a,
unsigned  terms 
)

Definition at line 52 of file d2-sbasis.cpp.

References truncate(), X, and Y.

Referenced by main(), and truncate().

◆ truncate() [2/5]

SBasis Geom::truncate ( SBasis const &  a,
unsigned  terms 
)
inline

Definition at line 361 of file sbasis.h.

References c, and Geom::SBasis::insert().

◆ truncate() [3/5]

SBasis2d Geom::truncate ( SBasis2d const &  a,
unsigned  terms 
)

◆ truncate() [4/5]

template<unsigned n>
SBasisN< n > Geom::truncate ( SBasisN< n > const &  a,
unsigned  first_size 
)
inline

Definition at line 857 of file sbasisN.h.

References c, and Geom::SBasisN< n >::sizes.

◆ truncate() [5/5]

template<typename T >
SBasisOf< T > Geom::truncate ( SBasisOf< T > const &  a,
unsigned  terms 
)
inline

Definition at line 456 of file sbasis-of.h.

References c.

◆ truncateResult()

void Geom::truncateResult ( Piecewise< SBasis > &  f,
int  order 
)

Definition at line 274 of file sbasis-math.cpp.

References order, and Geom::Piecewise< T >::segs.

Referenced by reciprocal(), and reciprocal().

◆ TYPED_TEST() [1/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Area   
)

Definition at line 268 of file rect-test.cpp.

References c.

◆ TYPED_TEST() [2/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Contains   
)

Definition at line 211 of file rect-test.cpp.

References c.

◆ TYPED_TEST() [3/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Dimensions   
)

Definition at line 290 of file rect-test.cpp.

◆ TYPED_TEST() [4/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Emptiness   
)

Definition at line 280 of file rect-test.cpp.

◆ TYPED_TEST() [5/13]

Geom::TYPED_TEST ( GenericRectTest  ,
EqualityTest   
)

Definition at line 131 of file rect-test.cpp.

◆ TYPED_TEST() [6/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Intersection   
)

Definition at line 186 of file rect-test.cpp.

References c, and intersect().

◆ TYPED_TEST() [7/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Intersects   
)

Definition at line 151 of file rect-test.cpp.

References c.

◆ TYPED_TEST() [8/13]

Geom::TYPED_TEST ( GenericRectTest  ,
JonCruzRect   
)

JonCruz failure: (10, 20)-(55,30) and (45,20)-(100,30) should intersect.

Definition at line 175 of file rect-test.cpp.

◆ TYPED_TEST() [9/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Modification   
)

Definition at line 319 of file rect-test.cpp.

◆ TYPED_TEST() [10/13]

Geom::TYPED_TEST ( GenericRectTest  ,
NearestEdgePoint   
)

Definition at line 378 of file rect-test.cpp.

◆ TYPED_TEST() [11/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Offset   
)

Definition at line 356 of file rect-test.cpp.

◆ TYPED_TEST() [12/13]

Geom::TYPED_TEST ( GenericRectTest  ,
OptRectDereference   
)

Definition at line 348 of file rect-test.cpp.

◆ TYPED_TEST() [13/13]

Geom::TYPED_TEST ( GenericRectTest  ,
Union   
)

Definition at line 237 of file rect-test.cpp.

References c.

◆ TYPED_TEST_CASE()

Geom::TYPED_TEST_CASE ( GenericRectTest  ,
CoordTypes   
)

◆ unify() [1/5]

Interval Geom::unify ( Interval const &  a,
Interval const &  b 
)
inline

Definition at line 217 of file interval.h.

◆ unify() [2/5]

IntRect Geom::unify ( IntRect const &  a,
IntRect const &  b 
)
inline

Definition at line 55 of file int-rect.h.

◆ unify() [3/5]

OptIntRect Geom::unify ( OptIntRect const &  a,
OptIntRect const &  b 
)
inline

Definition at line 58 of file int-rect.h.

◆ unify() [4/5]

OptRect Geom::unify ( OptRect const &  a,
OptRect const &  b 
)
inline

Definition at line 259 of file rect.h.

◆ unify() [5/5]

Rect Geom::unify ( Rect const &  a,
Rect const &  b 
)
inline

Definition at line 256 of file rect.h.

◆ union_list()

Rect Geom::union_list ( std::vector< Rect > const &  r)
inline

Union a list of rectangles.

Deprecated:
Use OptRect::from_range instead

Definition at line 265 of file rect.h.

References Geom::GenericRect< C >::unionWith().

Referenced by Geom::MonoCrosser::crossings(), and wrap_rect().

◆ unit_vector()

Point Geom::unit_vector ( Point const &  a)
related

Referenced by Inkscape::UI::Tools::PencilTool::_fitAndSplit(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::UI::Node::_updateAutoHandles(), Inkscape::UI::PathManipulator::_updateOutline(), Geom::RatQuad::circularArc(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), Inkscape::UI::direction(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEAngleBisector::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEParallel::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPerpBisector::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPETangentToCurve::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::LivePathEffect::LPEParallel::doOnApply(), Inkscape::UI::Handle::dragged(), draw_ray(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Inkscape::Extension::Internal::PrintEmf::fill(), Inkscape::Extension::Internal::PrintWmf::fill(), Inkscape::LivePathEffect::findShadowedTime(), generate_bezier(), Geom::BezierFitter::generate_bezier(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::UI::Handle::grabbed(), line_best_fit(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), plot_offset(), Box3D::Line::point_from_lambda(), reflection(), Inkscape::UI::PathManipulator::scaleHandle(), Inkscape::UI::Handle::setDirection(), Inkscape::UI::Handle::setLength(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Inkscape::UI::Node::setType(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), tighten(), toPoly(), Geom::Piecewise< T >::unitVector(), Inkscape::Extension::Internal::PrintEmf::vector_rect_alignment(), and wrap_point().

◆ unitTangentAt()

◆ unitVector() [1/2]

◆ unitVector() [2/2]

Piecewise< D2< SBasis > > Geom::unitVector ( Piecewise< D2< SBasis > > const &  vect,
double  tol = .01,
unsigned  order = 3 
)
related

◆ V3()

NL::Vector Geom::V3 ( double  a,
double  b,
double  c 
)

Definition at line 65 of file nl-vector-test.cpp.

References c.

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().

◆ valuation()

template<unsigned n>
unsigned Geom::valuation ( SBasisN< n > const &  a,
double  tol = 0 
)
inline

Returns the degree of the first non zero coefficient.

Parameters
asbasis function
tollargest abs val considered 0
Returns
first non zero coefficient

Definition at line 1038 of file sbasisN.h.

Referenced by compose_inverse().

◆ wangs_theorem()

unsigned Geom::wangs_theorem ( OldBezier  )

◆ winding()

int Geom::winding ( Path const &  path,
Point const &  p 
)

Compute winding number of the path at the specified point.

Definition at line 16 of file path-intersection.cpp.

References Geom::Path::winding().

Referenced by contains(), TEST_F(), and winding().

◆ wrap_dist()

double Geom::wrap_dist ( double  from,
double  to,
double  size,
bool  rev 
)

Definition at line 15 of file crossing.cpp.

References size.

◆ write_svg_path()

std::string Geom::write_svg_path ( PathVector const &  pv,
int  prec = -1,
bool  optimize = false,
bool  shorthands = true 
)

◆ xAx_descr()

double Geom::xAx_descr ( xAx const &  C)

Definition at line 352 of file conicsec.cpp.

References Geom::xAx::c, and det3().

Referenced by intersect().

Variable Documentation

◆ _svg_path_actions

const char Geom::_svg_path_actions[]
static
Initial value:
= {
0, 1, 0, 1, 1, 1, 2, 1,
3, 1, 4, 1, 5, 1, 15, 2,
1, 0, 2, 1, 6, 2, 1, 7,
2, 1, 8, 2, 1, 9, 2, 1,
10, 2, 1, 11, 2, 1, 12, 2,
1, 13, 2, 1, 14, 2, 2, 0,
2, 3, 0, 2, 4, 0, 2, 5,
0, 3, 1, 6, 0, 3, 1, 7,
0, 3, 1, 8, 0, 3, 1, 9,
0, 3, 1, 10, 0, 3, 1, 11,
0, 3, 1, 12, 0, 3, 1, 13,
0, 3, 1, 14, 0
}

Definition at line 48 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_eof_actions

const char Geom::_svg_path_eof_actions[]
static

Definition at line 1043 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_index_offsets

const short Geom::_svg_path_index_offsets[]
static

Definition at line 513 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_indicies

const short Geom::_svg_path_indicies[]
static

Definition at line 550 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_key_offsets

const short Geom::_svg_path_key_offsets[]
static

Definition at line 63 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_range_lengths

const char Geom::_svg_path_range_lengths[]
static

Definition at line 476 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_single_lengths

const char Geom::_svg_path_single_lengths[]
static

Definition at line 439 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_trans_actions

const char Geom::_svg_path_trans_actions[]
static

Definition at line 950 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_trans_keys

const char Geom::_svg_path_trans_keys[]
static

Definition at line 100 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ _svg_path_trans_targs

const short Geom::_svg_path_trans_targs[]
static

Definition at line 857 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ BEPSILON

const double Geom::BEPSILON = ldexp(1.0,-MAXDEPTH-1)

Definition at line 27 of file solve-bezier-parametric.cpp.

Referenced by control_poly_flat_enough().

◆ degen

xAx Geom::degen

Definition at line 70 of file conic-6.cpp.

Referenced by Geom::Ellipse::intersect(), TEST(), and TEST_F().

◆ MAXDEPTH

const unsigned Geom::MAXDEPTH = 64

Definition at line 25 of file solve-bezier-parametric.cpp.

Referenced by find_parametric_bezier_roots().

◆ svg_path_en_main

const int Geom::svg_path_en_main = 234
static

Definition at line 1083 of file svg-path-parser.cpp.

◆ svg_path_first_final

const int Geom::svg_path_first_final = 234
static

Definition at line 1081 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::_parse().

◆ svg_path_start

const int Geom::svg_path_start = 234
static

Definition at line 1080 of file svg-path-parser.cpp.

Referenced by Geom::SVGPathParser::reset().

◆ total_steps

unsigned Geom::total_steps

Definition at line 29 of file solve-bezier-parametric.cpp.

Referenced by find_parametric_bezier_roots().

◆ total_subs

unsigned Geom::total_subs

Definition at line 29 of file solve-bezier-parametric.cpp.

Referenced by find_parametric_bezier_roots().

◆ unconstrained_tangent

Point const Geom::unconstrained_tangent(0, 0) ( ,
 
)
static