9 template <
typename ADerived,
typename BDerived,
typename CDerived>
11 const Eigen::MatrixBase<ADerived>& a,
12 const Eigen::MatrixBase<BDerived>& b,
13 const Eigen::MatrixBase<CDerived>& c) ->
typename ADerived::Scalar
17 return typename ADerived::Scalar(.5) * ba.cross(ca).norm();
21 template <
typename ADerived,
typename BDerived,
typename CDerived>
23 const Eigen::MatrixBase<ADerived>& a,
24 const Eigen::MatrixBase<BDerived>& b,
25 const Eigen::MatrixBase<CDerived>& c) ->
typename ADerived::Scalar
27 auto ba = (b - a).eval();
28 auto ca = (c - a).eval();
29 return typename ADerived::Scalar(.5) * ba.homogeneous().cross(ca.homogeneous()).z();
32 template <
typename ADerived,
typename BDerived,
typename CDerived>
34 const Eigen::MatrixBase<ADerived>& a,
35 const Eigen::MatrixBase<BDerived>& b,
36 const Eigen::MatrixBase<CDerived>& c) ->
typename ADerived::Scalar
38 return std::abs(triangle_signed_2d(a, b, c));
auto triangle_unsigned_2d_area(const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
auto triangle_3d_area(const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
auto triangle_signed_2d_area(const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
Rational abs(const Rational &r0)