33 class IVisualization3D;
51 double cdsq = std::pow((c00 - c11), 2) / 4.;
52 double cosq = c01 * c01;
55 double lambda0 = (c00 + c11) / 2. + std::sqrt(cdsq + cosq);
56 double lambda1 = (c00 + c11) / 2. - std::sqrt(cdsq + cosq);
57 double theta = atan2(lambda0 - c00, c01);
59 return {
lambda0, lambda1, theta};
75 double ctheta = std::cos(theta);
76 double stheta = std::sin(theta);
78 double l1sq = std::sqrt(lambda0);
79 double l2sq = std::sqrt(lambda1);
82 std::vector<Vector3> ellipse;
83 ellipse.reserve(lseg);
84 double thetaStep = 2 * M_PI / lseg;
85 for (
size_t it = 0;
it < lseg; ++
it) {
86 double phi = -M_PI +
it * thetaStep;
87 double cphi = std::cos(phi);
88 double sphi = std::sin(phi);
89 double x = lposition.x() + (l1sq * ctheta * cphi - l2sq * stheta * sphi);
90 double y = lposition.y() + (l1sq * stheta * cphi + l2sq * ctheta * sphi);
121 double directionScale = 1,
double angularErrorScale = 1,
135 template <
typename parameters_t>
139 double momentumScale = 1.,
double locErrorScale = 1.,
140 double angularErrorScale = 1.,
144 if (surfConfig.visible) {
146 Transform3::Identity(), surfConfig);
151 auto direction = parameters.direction();
152 double p = parameters.absoluteMomentum();
156 Vector3 parLength = p * momentumScale * direction;
162 position + parLength, 4., 2.5, lparConfig);
164 if (parameters.covariance().has_value()) {
165 auto paramVec = parameters.parameters();
166 auto lposition = paramVec.template block<2, 1>(0, 0);
169 const auto&
covariance = *parameters.covariance();
171 covariance.template block<2, 2>(0, 0),
172 parameters.referenceSurface().transform(
gctx),
173 locErrorScale, covConfig);
176 helper,
position, direction, covariance.template block<2, 2>(2, 2),
177 0.9 * p * momentumScale, angularErrorScale, covConfig);
194 const double locErrorScale = 1.,
196 if (locErrorScale <= 0) {
197 throw std::invalid_argument(
"locErrorScale must be > 0");
199 if (measurementConfig.visible) {
201 locErrorScale, measurementConfig);
222 template <
typename traj_t>
226 double momentumScale = 1.,
double locErrorScale = 1.,
227 double angularErrorScale = 1.,
239 multiTraj.visitBackwards(entryIndex, [&](
const auto&
state) {
247 if (
state.index() == 0) {
248 locErrorScale = locErrorScale * 0.1;
249 angularErrorScale = angularErrorScale * 0.1;
253 if (surfaceConfig.visible) {
255 Transform3::Identity(), surfaceConfig);
261 if (
state.hasCalibrated() and
state.calibratedSize() == 2) {
262 const Vector2& lposition =
state.template calibrated<2>();
264 state.template calibratedCovariance<2>();
266 state.referenceSurface().transform(
gctx), locErrorScale,
272 if (predictedConfig.visible and
state.hasPredicted()) {
276 state.predicted(),
state.predictedCovariance(),
278 gctx, momentumScale, locErrorScale, angularErrorScale,
279 predictedConfig, predictedConfig,
ViewConfig(
false));
282 if (filteredConfig.visible and
state.hasFiltered()) {
288 gctx, momentumScale, locErrorScale, angularErrorScale,
289 filteredConfig, filteredConfig,
ViewConfig(
false));
292 if (smoothedConfig.visible and
state.hasSmoothed()) {
298 gctx, momentumScale, locErrorScale, angularErrorScale,
299 smoothedConfig, smoothedConfig,
ViewConfig(
false));