28 double d = (q -
p1).norm();
30 *H1 << p1.x() - q.x(), p1.y() - q.y(), p1.z() - q.z();
34 *H2 << -p1.x() + q.x(), -p1.y() + q.y(), -p1.z() + q.z();
41 double r =
sqrt(p.x() * p.x() + p.y() * p.y() + p.z() * p.z());
44 *H << p.x() / r, p.y() / r, p.z() / r;
52 Point3 normalized = p / p.norm();
55 double x2 = p.x() * p.x(), y2 = p.y() * p.y(),
z2 = p.z() * p.z();
56 double xy = p.x() * p.y(), xz = p.x() * p.z(), yz = p.y() * p.z();
57 *H << y2 +
z2, -
xy, -xz, -
xy, x2 +
z2, -yz, -xz, -yz, x2 + y2;
58 *H /=
pow(x2 + y2 + z2, 1.5);
67 return Point3(p.y() * q.z() - p.z() * q.y(), p.z() * q.x() - p.x() * q.z(),
68 p.x() * q.y() - p.y() * q.x());
73 if (H1) *H1 << q.x(), q.y(), q.z();
74 if (H2) *H2 << p.x(), p.y(), p.z();
75 return p.x() * q.x() + p.y() * q.y() + p.z() * q.z();
79 const size_t n = abPointPairs.size();
80 if (n == 0)
throw std::invalid_argument(
"Point3::mean input Point3Pair vector is empty");
81 Point3 aSum(0, 0, 0), bSum(0, 0, 0);
82 for (
const Point3Pair &abPair : abPointPairs) {
84 bSum += abPair.second;
86 const double f = 1.0 /
n;
87 return {aSum *
f, bSum * f};
92 os << p.first <<
" <-> " << p.second;
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
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
double distance3(const Point3 &p1, const Point3 &q, OptionalJacobian< 1, 3 > H1, OptionalJacobian< 1, 3 > H2)
distance between two points
Point3 cross(const Point3 &p, const Point3 &q, OptionalJacobian< 3, 3 > H1, OptionalJacobian< 3, 3 > H2)
cross product
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
EIGEN_DEVICE_FUNC const Scalar & q
double norm3(const Point3 &p, OptionalJacobian< 1, 3 > H)
Distance of the point from the origin, with Jacobian.
Matrix3 skewSymmetric(double wx, double wy, double wz)
Point3 normalize(const Point3 &p, OptionalJacobian< 3, 3 > H)
normalize, with optional Jacobian
ofstream os("timeSchurFactors.csv")
ostream & operator<<(ostream &os, const gtsam::Point3Pair &p)
Point3Pair means(const std::vector< Point3Pair > &abPointPairs)
Calculate the two means of a set of Point3 pairs.
double dot(const Point3 &p, const Point3 &q, OptionalJacobian< 1, 3 > H1, OptionalJacobian< 1, 3 > H2)
dot product
Jet< T, N > pow(const Jet< T, N > &f, double g)
std::pair< Point3, Point3 > Point3Pair