28 auto n = v1.
cross(v2);
37 const auto & a = line_segment.
start();
38 const auto & b = line_segment.
end();
41 const Point dir = b - a;
49 const Real det = edge1 * pvec;
53 const Real inv_det = 1.0 / det;
57 const Real u = (tvec * pvec) * inv_det;
58 if (!MooseUtils::absoluteFuzzyGreaterEqual(u, 0.0,
eps) ||
59 !MooseUtils::absoluteFuzzyLessEqual(u, 1.0,
eps))
64 const Real v = (dir * qvec) * inv_det;
65 if (!MooseUtils::absoluteFuzzyGreaterEqual(v, 0.0,
eps) ||
66 !MooseUtils::absoluteFuzzyLessEqual(u + v, 1.0,
eps))
70 const Real t = (edge2 * qvec) * inv_det;
71 if (!MooseUtils::absoluteFuzzyGreaterEqual(t, 0.0,
eps) ||
72 !MooseUtils::absoluteFuzzyLessEqual(t, 1.0,
eps))
76 intersect_p = a + dir * t;
92 Real max_sq_dist = 0.0;
96 if (dist_sq > max_sq_dist)
97 max_sq_dist = dist_sq;
const Point & end() const
Ending of the line segment.
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
int eps(unsigned int i, unsigned int j)
2D version
Ball primitive: a circle in 2D or a sphere in 3D.
static constexpr Real TOLERANCE
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff...
Ball computeBoundingBall() const override
Compute a bounding ball for this triangle.
const Point & start() const
Beginning of the line segment.
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross(const TypeVector< T2 > &v) const
bool intersect(const LineSegment &l, libMesh::Point &intersect_p) const
Check if a line segment intersects this triangle.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
libMesh::Point normal() const
Normal vector of the triangle.