20 #ifndef vtk_m_worklet_cellmetrics_TypeOfCellTriangle
21 #define vtk_m_worklet_cellmetrics_TypeOfCellTriangle
45 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
48 const Vector L0(pts[2] - pts[1]);
58 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
61 const Vector L1(pts[0] - pts[2]);
71 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
74 const Vector L2(pts[1] - pts[0]);
84 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
87 const Scalar l0 =
static_cast<Scalar
>(
98 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
101 const Scalar l1 =
static_cast<Scalar
>(
112 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
115 const Scalar l2 =
static_cast<Scalar
>(
129 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
132 const Scalar l0 = GetTriangleL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
133 const Scalar l1 = GetTriangleL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
134 const Scalar l2 = GetTriangleL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
135 const Scalar lmax = vtkm::Max(l0, vtkm::Max(l1, l2));
148 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
151 const Scalar l0 = GetTriangleL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
152 const Scalar l1 = GetTriangleL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
153 const Scalar l2 = GetTriangleL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
154 const Scalar lmin = vtkm::Min(l0, vtkm::Min(l1, l2));
165 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
168 const Vector L0 = GetTriangleL0<Scalar, Vector, CollectionOfPoints>(pts);
169 const Vector L1 = GetTriangleL1<Scalar, Vector, CollectionOfPoints>(pts);
170 const Scalar hhalf(0.5);
171 const Scalar crossProductMagnitude =
173 const Scalar area = hhalf * crossProductMagnitude;
184 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
187 const Scalar two(2.0);
188 const Scalar area = GetTriangleArea<Scalar, Vector, CollectionOfPoints>(pts);
189 const Scalar l0 = GetTriangleL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
190 const Scalar l1 = GetTriangleL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
191 const Scalar l2 = GetTriangleL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
192 const Scalar inradius = (two * area) / (l0 + l1 + l2);
203 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
206 const Scalar four(4.0);
207 const Scalar area = GetTriangleArea<Scalar, Vector, CollectionOfPoints>(pts);
208 const Scalar l0 = GetTriangleL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
209 const Scalar l1 = GetTriangleL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
210 const Scalar l2 = GetTriangleL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
211 const Scalar circumradius = (l0 * l1 * l2) / (four * area);