Inkscape
Vector Graphics Editor
|
Adaptor that creates 2D functions from 1D ones. More...
#include <d2.h>
Public Types | |
typedef T | D1Value |
typedef T & | D1Reference |
typedef T const & | D1ConstReference |
typedef Point | output_type |
Public Member Functions | |
D2 () | |
D2 (Point const &a) | |
D2 (T const &a, T const &b) | |
template<typename Iter > | |
D2 (Iter first, Iter last) | |
D2 (std::vector< Point > const &vec) | |
T & | operator[] (unsigned i) |
T const & | operator[] (unsigned i) const |
Point | point (unsigned i) const |
bool | isZero (double eps=EPSILON) const |
bool | isConstant (double eps=EPSILON) const |
bool | isFinite () const |
Point | at0 () const |
Point | at1 () const |
Point | pointAt (double t) const |
Point | valueAt (double t) const |
std::vector< Point > | valueAndDerivatives (double t, unsigned n) const |
D2< SBasis > | toSBasis () const |
Point | operator() (double t) const |
Point | operator() (double x, double y) const |
Private Attributes | |
T | f [2] |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T > | |
T | dot (D2< T > const &a, Point const &b) |
Calculates the 'dot product' or 'inner product' of a and b . | |
template<typename T > | |
T | cross (D2< T > const &a, D2< T > const &b) |
Calculates the 'cross product' or 'outer product' of a and b . | |
D2< Piecewise< SBasis > > | tan2 (SBasis const &angle, double tol, unsigned order) |
tan2 is the pseudo-inverse of atan2. | |
void | length_integrating (D2< SBasis > const &B, double &result, double &abs_error, double tol) |
Calculates the length of a D2<SBasis> through gsl integration. | |
double | length (D2< SBasis > const &s, double tol) |
Calculates the length of a D2<SBasis> through gsl integration. | |
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, double epsilon) |
returns the cubics fitting direction and curvature of a given input curve at two points. | |
std::vector< double > | find_tangents (Point P, D2< SBasis > const &A) |
returns all the parameter values of A whose tangent passes through P. | |
std::vector< double > | find_normals (Point P, D2< SBasis > const &A) |
returns all the parameter values of A whose normal passes through P. | |
std::vector< double > | find_normals_by_vector (Point V, D2< SBasis > const &A) |
returns all the parameter values of A whose normal is parallel to vector V. | |
std::vector< double > | find_tangents_by_vector (Point V, D2< SBasis > const &A) |
returns all the parameter values of A whose tangent is parallel to vector V. | |
Adaptor that creates 2D functions from 1D ones.
typedef T const& Geom::D2< T >::D1ConstReference |
|
inline |
Definition at line 64 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Definition at line 65 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
|
inline |
Definition at line 69 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Definition at line 75 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Definition at line 86 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Definition at line 121 of file d2.h.
References Geom::D2< T >::at0(), Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::D2< T >::at0(), Geom::Piecewise< T >::atan2(), Geom::Piecewise< T >::centroid(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::hausdorf(), Geom::hausdorfl(), Geom::monotonic_smash_intersect(), Geom::nearest_time(), Geom::path_from_sbasis(), recursive_curvature_fitter(), sequential_curvature_fitter(), toPoly(), and Geom::Piecewise< T >::unitVector().
Definition at line 125 of file d2.h.
References Geom::D2< T >::at1(), Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::D2< T >::at1(), Geom::build_from_sbasis(), Geom::Piecewise< T >::centroid(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::hausdorf(), Geom::hausdorfl(), Geom::monotonic_smash_intersect(), Geom::nearest_time(), and Geom::Piecewise< T >::unitVector().
Definition at line 113 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::nearest_time().
|
inline |
Definition at line 117 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::build_from_sbasis().
Definition at line 109 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::touching_circle().
|
inline |
Definition at line 100 of file d2.h.
References Geom::D2< T >::f.
|
inline |
Definition at line 101 of file d2.h.
References Geom::D2< T >::f.
Definition at line 102 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Definition at line 148 of file d2.h.
References Geom::D2< T >::f, Geom::D2< T >::toSBasis(), Geom::X, and Geom::Y.
Referenced by Geom::D2< T >::toSBasis().
|
inline |
Definition at line 138 of file d2.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Geom::intersect_polish_root(), and Geom::unitTangentAt().
Definition at line 133 of file d2.h.
Referenced by Geom::xAx::crossings(), Geom::Ellipse::intersect(), linearizeCusps(), Geom::monotonic_smash_intersect(), Geom::nearest_time(), and toPoly().
|
related |
returns the cubics fitting direction and curvature of a given input curve at two points.
The input can be the value, speed, and acceleration or value, speed, and cross(acceleration,speed) of the original curve at the both ends. (the second is often technically useful, as it avoids unnecessary division by |v|^2) Recall that K=1/R=cross(acceleration,speed)/|speed|^3.
Moreover, a 7-th argument 'insist_on_speed_signs' can be supplied to select solutions:
If insist_on_speed_signs == 1, only consider solutions where speeds at both ends are positively proportional to the given ones. If insist_on_speed_signs == 0, allow speeds to point in the opposite direction (both at the same time) If insist_on_speed_signs == -1, allow speeds to point in both direction independently.
Definition at line 630 of file sbasis-geometric.cpp.
References c, Geom::cross(), Geom::curvature(), result, solve_lambda0(), and Geom::Piecewise< T >::valueAt().
|
related |
returns all the parameter values of A whose normal passes through P.
Definition at line 755 of file sbasis-geometric.cpp.
References Geom::derivative(), Geom::dot(), and Geom::roots().
|
related |
returns all the parameter values of A whose normal is parallel to vector V.
Definition at line 764 of file sbasis-geometric.cpp.
References Geom::derivative(), Geom::dot(), and Geom::roots().
|
related |
returns all the parameter values of A whose tangent passes through P.
Definition at line 746 of file sbasis-geometric.cpp.
References Geom::cross(), Geom::derivative(), and Geom::roots().
|
related |
returns all the parameter values of A whose tangent is parallel to vector V.
Definition at line 772 of file sbasis-geometric.cpp.
References Geom::derivative(), Geom::dot(), Geom::roots(), and Geom::rot90().
Calculates the length of a D2<SBasis> through gsl integration.
s | the Element. |
tol | the maximum error allowed. |
If you only want the total length, this routine faster and more accurate than constructing an arcLengthSb.
Definition at line 484 of file sbasis-geometric.cpp.
References Geom::length_integrating(), and result.
|
related |
Calculates the length of a D2<SBasis> through gsl integration.
B | the Element. |
tol | the maximum error allowed. |
result | variable to be incremented with the length of the path |
abs_error | variable to be incremented with the estimated error |
If you only want the length, this routine may be faster/more accurate.
Definition at line 458 of file sbasis-geometric.cpp.
References Geom::derivative(), Geom::dot(), result, sb_length_integrating(), and w.
|
related |
tan2 is the pseudo-inverse of atan2.
It takes an angle and returns a unit_vector that points in the direction of angle.
angle | a piecewise function of angle wrt t. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation , SBasis |
Definition at line 199 of file sbasis-geometric.cpp.
References order, and Geom::tan2().
|
private |
Definition at line 57 of file d2.h.
Referenced by Geom::D2< T >::at0(), Geom::D2< T >::at1(), Geom::D2< T >::D2(), Geom::D2< T >::D2(), Geom::D2< T >::D2(), Geom::D2< T >::D2(), Geom::D2< T >::D2(), Geom::D2< T >::isConstant(), Geom::D2< T >::isFinite(), Geom::D2< T >::isZero(), Geom::D2< T >::operator[](), Geom::D2< T >::operator[](), Geom::D2< T >::point(), Geom::D2< T >::toSBasis(), and Geom::D2< T >::valueAndDerivatives().