19 using Line = Eigen::ParametrizedLine<double, 2>;
20 using Plane = Eigen::Hyperplane<double, 2>;
23 double det = ldir.x() * dir.y() - ldir.y() * dir.x();
28 auto line = Line(origin, dir);
29 auto d = line.intersectionParameter(Plane::Through(s0, s1));
31 return Intersection2D(origin +
d * dir,
d, Intersection2D::Status::reachable);
34 std::pair<Acts::Intersection2D, Acts::Intersection2D>
39 -> std::pair<Acts::Intersection2D, Acts::Intersection2D> {
42 double solD = std::copysign(toSolD.norm(), toSolD.dot(dir));
43 double altD = std::copysign(toAltD.norm(), toAltD.dot(dir));
45 if (solD * solD < altD * altD) {
46 return {
Intersection2D(sol, solD, Intersection2D::Status::reachable),
49 return {
Intersection2D(alt, altD, Intersection2D::Status::reachable),
55 double solx = origin.x();
56 double D = 1. - solx * solx / (Rx * Rx);
58 double sqrtD = std::sqrt(D);
61 return createSolution(sol, alt);
64 Intersection2D::Status::reachable),
69 double soly = origin.y();
70 double D = 1. - soly * soly / (Ry * Ry);
72 double sqrtD = std::sqrt(D);
75 return createSolution(sol, alt);
78 Intersection2D::Status::reachable),
84 double k = dir.y() / dir.x();
85 double d = origin.y() - k * origin.x();
87 double alpha = 1. / (Rx * Rx) + k * k / Ry2;
88 double beta = 2. * k * d / Ry2;
89 double gamma = d * d / Ry2 - 1;
95 double solD = std::copysign(toSolD.norm(), toSolD.dot(dir));
96 return {
Intersection2D(sol, solD, Intersection2D::Status::reachable),
99 double x0 = solver.
first;
100 double x1 = solver.
second;
103 return createSolution(sol, alt);