From cd84ffd14939b5e521bf0c98ece79dddaee6e610 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 5 Feb 2012 11:18:51 +0000 Subject: [PATCH] cross_product.hpp which is now splitted into cross_product (the real) and determinant [SVN r76895] --- .../geometry/arithmetic/cross_product.hpp | 70 ------------------- 1 file changed, 70 deletions(-) diff --git a/include/boost/geometry/arithmetic/cross_product.hpp b/include/boost/geometry/arithmetic/cross_product.hpp index da90ce40d..47e7fe105 100644 --- a/include/boost/geometry/arithmetic/cross_product.hpp +++ b/include/boost/geometry/arithmetic/cross_product.hpp @@ -71,30 +71,6 @@ struct cross_product } }; - -template -class cross_product2 -{ - template - static inline ReturnType rt(T const& v) - { - return boost::numeric_cast(v); - } - -public : - - // Most common dimension, as also defined by Wolfram: - // http://mathworld.wolfram.com/CrossProduct.html - // "In two dimensions, the analog of the cross product for u=(u_x,u_y) and v=(v_x,v_y) is - // uxv = det(uv) - // = u_x v_y - u_y v_x" - static inline ReturnType apply(U const& ux, U const& uy - , V const& vx, V const& vy) - { - return rt(ux) * rt(vy) - rt(uy) * rt(vx); - } -}; - } // namespace detail #endif // DOXYGEN_NO_DETAIL @@ -129,52 +105,6 @@ inline P1 cross_product(P1 const& p1, P2 const& p2) } -/*! -\brief Computes the cross product of two vectors, version for four values -\details Because we often have the four coordinate values (often differences) - available, it is convenient to have a version which works directly on these, - without having to make a (temporary) Point or Vector -\ingroup arithmetic -\return the cross product value - */ -template -inline ReturnType cross_product2(U const& ux, U const& uy - , V const& vx, V const& vy) -{ - return detail::cross_product2 - < - ReturnType, U, V - >::apply(ux, uy, vx, vy); -} - -// Synonym, because yes, sometimes the algorithm calls it "determinant" -template -inline ReturnType determinant(U const& ux, U const& uy - , V const& vx, V const& vy) -{ - return detail::cross_product2 - < - ReturnType, U, V - >::apply(ux, uy, vx, vy); -} - - -// TEMPORARY, to be harmonized with cross_product -template -inline ReturnType cross_product2(U const& u, V const& v) -{ - BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); - BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); - - return detail::cross_product2 - < - ReturnType, - typename geometry::coordinate_type::type, - typename geometry::coordinate_type::type - >::apply(get<0>(u), get<1>(u), get<0>(v), get<1>(v)); -} - - }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP