24#ifndef DUMUX_GEOMETRY_CIRCUMSPHERE_HH
25#define DUMUX_GEOMETRY_CIRCUMSPHERE_HH
39static inline Sphere<typename Point::value_type, Point::dimension>
42 const auto ac = c - a;
43 const auto ab = b - a;
45 const auto distCenterToA = (
crossProduct(n, ab)*ac.two_norm2() +
crossProduct(ac, n)*ab.two_norm2()) / (2.0*n.two_norm2());
47 return { a + distCenterToA, distCenterToA.two_norm() };
54template<
class Geometry,
typename std::enable_if_t<Geometry::mydimension == 2,
int> = 0>
55static inline Sphere<typename Geometry::ctype, Geometry::coorddimension>
58 assert(triangle.corners() == 3 &&
"Geometry is not a triangle.");
Define some often used mathematical functions.
A function to compute bounding spheres of points clouds or convex polytopes.
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:40
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:654