35 adoreMatrix<T, 1, 0> values;
36 values = dlib::zeros_matrix<T>(1, samples.nc());
37 adoreMatrix<T, 2, 1> dpx, ddpx;
39 for (
int i = 0; i < samples.nc(); i++)
41 dpx = dp->
f(samples(i));
42 ddpx = ddp->
f(samples(i));
43 v = sqrt(dpx(0)*dpx(0) + dpx(1)*dpx(1));
44 values(i) = (dpx(0)*ddpx(1) - ddpx(0)*dpx(1)) / (v*v*v);
55 template<
int d1,
int d2,
typename T,
int nd>
113 virtual T
f(T
x)
const
117 auto dddq =
dp->
f(
x);
118 return (dddq(d2)*dq(d1)-dddq(d1)*dq(d2)) - (ddq(d2)*dq(d1)-ddq(d1)*dq(d2))*(ddq(d1)*dq(d1)+ddq(d2)*dq(d2))/(dq(d1)*dq(d1)+dq(d2)*dq(d2));
135 virtual void bound(
const T& xmin,
const T& xmax, T& ymin, T& ymax)
146 template<
int d1,
int d2,
typename T,
int nd>
201 virtual T
f(T
x)
const
204 auto ddq =
ddp->
f(
x);
205 return (ddq(d2)*dq(d1)-ddq(d1)*dq(d2)) / sqrt(dq(d1)*dq(d1)+dq(d2)*dq(d2));
223 virtual void bound(
const T& xmin,
const T& xmax, T& ymin, T& ymax)
virtual CT f(DT x) const =0
virtual DT limitHi() const =0
virtual DT limitLo() const =0
virtual ALFunction< DT, CT > * create_derivative()=0
Definition: curvature.h:148
virtual T limitHi()
Definition: curvature.h:190
bool owner_of_dpddp
Definition: curvature.h:155
TPath * p
Definition: curvature.h:152
virtual ALFunction< T, T > * clone()
Definition: curvature.h:207
TPath * dp
Definition: curvature.h:153
virtual T f(T x) const
Definition: curvature.h:201
virtual void setLimits(T lo, T hi)
Definition: curvature.h:183
virtual T limitLo()
Definition: curvature.h:194
Curvature2d(TPath *p)
Definition: curvature.h:160
virtual ALFunction< T, T > * create_derivative()
Definition: curvature.h:218
TPath * ddp
Definition: curvature.h:154
ALFunction< T, adoreMatrix< T, nd, 1 > > TPath
Definition: curvature.h:150
~Curvature2d()
Definition: curvature.h:175
Curvature2d(TPath *dp, TPath *ddp)
Definition: curvature.h:170
virtual void bound(const T &xmin, const T &xmax, T &ymin, T &ymax)
Definition: curvature.h:223
Definition: alfunction.h:38
Definition: alfunction.h:46
Definition: llinearpiecewisefunction.h:32
Definition: curvature.h:57
virtual T limitHi()
Definition: curvature.h:102
virtual void bound(const T &xmin, const T &xmax, T &ymin, T &ymax)
Definition: curvature.h:135
TPath * dddp
Definition: curvature.h:64
virtual T limitLo()
Definition: curvature.h:106
TPath * ddp
Definition: curvature.h:63
TPath * p
Definition: curvature.h:61
ALFunction< T, adoreMatrix< T, nd, 1 > > TPath
Definition: curvature.h:59
TPath * dp
Definition: curvature.h:62
~PartialCurvatureDerivative2d()
Definition: curvature.h:86
bool owner_of_dpddp
Definition: curvature.h:65
PartialCurvatureDerivative2d(TPath *dp, TPath *ddp, TPath *dddp)
Definition: curvature.h:81
virtual void setLimits(T lo, T hi)
Definition: curvature.h:95
virtual ALFunction< T, T > * clone()
Definition: curvature.h:120
virtual T f(T x) const
Definition: curvature.h:113
PartialCurvatureDerivative2d(TPath *p)
Definition: curvature.h:70
virtual ALFunction< T, T > * create_derivative()
Definition: curvature.h:131
ALFunction< T, T > * sample_curvature(ALFunction< T, adoreMatrix< T, 2, 1 >> *path, adoreMatrix< T, 1, 0 > samples)
Definition: curvature.h:31
x
Definition: adore_set_goal.py:30
Definition: areaofeffectconverter.h:20