14#ifndef DUMUX_GEOMETRY_CIRCUMSPHERE_HH
15#define DUMUX_GEOMETRY_CIRCUMSPHERE_HH
29static inline Sphere<typename Point::value_type, Point::dimension>
32 const auto ac = c - a;
33 const auto ab = b - a;
35 const auto distCenterToA = (
crossProduct(n, ab)*ac.two_norm2() +
crossProduct(ac, n)*ab.two_norm2()) / (2.0*n.two_norm2());
37 return { a + distCenterToA, distCenterToA.two_norm() };
44template<
class Geometry,
typename std::enable_if_t<Geometry::mydimension == 2,
int> = 0>
45static inline Sphere<typename Geometry::ctype, Geometry::coorddimension>
48 assert(triangle.corners() == 3 &&
"Geometry is not a triangle.");
Dune::FieldVector< Scalar, 3 > crossProduct(const Dune::FieldVector< Scalar, 3 > &vec1, const Dune::FieldVector< Scalar, 3 > &vec2)
Cross product of two vectors in three-dimensional Euclidean space.
Definition: math.hh:671
static Sphere< typename Point::value_type, Point::dimension > circumSphereOfTriangle(const Point &a, const Point &b, const Point &c)
Computes the circumsphere of a triangle.
Definition: circumsphere.hh:30
Define some often used mathematical functions.
A function to compute bounding spheres of points clouds or convex polytopes.