27 Rot2 Rot2::fromCosSin(
double c,
double s) {
28 if (
std::abs(c * c + s * s - 1.0) > 1
e-9) {
29 double norm_cs =
sqrt(c*c + s*s);
44 uniform_real_distribution<double> randomAngle(-
M_PI,
M_PI);
45 double angle = randomAngle(rng);
46 return fromAngle(angle);
51 cout << s <<
": " <<
theta() << endl;
55 bool Rot2::equals(
const Rot2&
R,
double tol)
const {
61 double scale = c_*c_ + s_*s_;
63 scale =
pow(scale, -0.5);
77 return Rot2::fromAngle(
v(0));
91 rvalue_ << c_, -s_, s_, c_;
96 Matrix2 Rot2::transpose()
const {
98 rvalue_ << c_, s_, -s_, c_;
106 const Point2 q =
Point2(c_ * p.x() + -s_ * p.y(), s_ * p.x() + c_ * p.y());
107 if (H1) *H1 << -q.y(), q.x();
116 const Point2 q =
Point2(c_ * p.x() + s_ * p.y(), -s_ * p.x() + c_ * p.y());
117 if (H1) *H1 << q.y(), -q.x();
118 if (H2) *H2 = transpose();
124 double x = d.x(),
y = d.y(),
d2 = x * x +
y *
y,
n =
sqrt(
d2);
127 *H << -y /
d2, x /
d2;
129 return Rot2::fromCosSin(x / n, y / n);
131 if (H) *H << 0.0, 0.0;
void print(const Matrix &A, const string &s, ostream &stream)
Rot2 R(Rot2::fromAngle(0.1))
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Pose2_ Expmap(const Vector3_ &xi)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
static void normalize(Signature::Row &row)
P unrotate(const T &r, const P &pt)
P rotate(const T &r, const P &pt)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
EIGEN_DEVICE_FUNC const Scalar & q
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
Jet< T, N > pow(const Jet< T, N > &f, double g)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x