// Copyright (c) 2003-2004  Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
// and Tel-Aviv University (Israel).  All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.6-branch/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h $
// $Id: global_functions_internal_3.h 52284 2009-10-13 08:34:43Z sloriot $
// 
//
// Author(s)     : Sylvain Pion
 
#ifndef CGAL_KERNEL_GLOBAL_FUNCTIONS_INTERNAL_3_H
#define CGAL_KERNEL_GLOBAL_FUNCTIONS_INTERNAL_3_H

// Generic functions calling the kernel functor.
// See comments in CGAL/Kernel/global_functions_internal_3.h.

CGAL_BEGIN_NAMESPACE

namespace internal {

template <typename K>
inline
typename K::Angle
angle(const typename K::Point_3 &p,
      const typename K::Point_3 &q,
      const typename K::Point_3 &r, const K &k)
{
  return k.angle_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
are_ordered_along_line(const typename K::Point_3 &p,
                       const typename K::Point_3 &q,
                       const typename K::Point_3 &r, const K& k)
{
  return k.are_ordered_along_line_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
are_strictly_ordered_along_line(const typename K::Point_3 &p,
                                const typename K::Point_3 &q,
                                const typename K::Point_3 &r,
                                const K& k)
{
  return k.are_strictly_ordered_along_line_3_object()(p, q, r);
}

template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const K& k)
{
  return k.construct_barycenter_3_object()(p1, w1, p2);
}
  
template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const typename K::FT& w2, const K& k)
{
  return k.construct_barycenter_3_object()(p1, w1, p2, w2);
}
  
template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const typename K::FT& w2,
           const typename K::Point_3 &p3, const K& k)
{        
  return k.construct_barycenter_3_object()(p1, w1, p2, w2, p3);
}
  
template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const typename K::FT& w2,
           const typename K::Point_3 &p3, const typename K::FT& w3, const K& k)
{        
  return k.construct_barycenter_3_object()(p1, w1, p2, w2, p3, w3);
}        

template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const typename K::FT& w2,
           const typename K::Point_3 &p3, const typename K::FT& w3,
           const typename K::Point_3 &p4, const K& k)
{
  return k.construct_barycenter_3_object()(p1, w1, p2, w2, p3, w3, p4);
}

template < class K >
inline
typename K::Point_3
barycenter(const typename K::Point_3 &p1, const typename K::FT& w1,
           const typename K::Point_3 &p2, const typename K::FT& w2,
           const typename K::Point_3 &p3, const typename K::FT& w3,
           const typename K::Point_3 &p4, const typename K::FT& w4, const K& k)
{
  return k.construct_barycenter_3_object()(p1, w1, p2, w2, p3, w3, p4, w4);
}

template <typename K>
inline
typename K::Plane_3
bisector(const typename K::Point_3 &p,
         const typename K::Point_3 &q, const K &k)
{
  return k.construct_bisector_3_object()(p, q);
}

template <typename K>
inline
typename K::Plane_3
bisector(const typename K::Plane_3 &h1,
         const typename K::Plane_3 &h2, const K &k)
{
  return k.construct_bisector_3_object()(h1, h2);
}

template < class K >
inline
typename K::Point_3
centroid(const typename K::Point_3 &p,
         const typename K::Point_3 &q,
         const typename K::Point_3 &r,
         const typename K::Point_3 &s, const K &k)
{
  return k.construct_centroid_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::Point_3
centroid(const typename K::Point_3 &p,
         const typename K::Point_3 &q,
         const typename K::Point_3 &r, const K &k)
{
  return k.construct_centroid_3_object()(p, q, r);
}

template < class K >
inline
typename K::Point_3
centroid(const typename K::Tetrahedron_3 &t, const K &k)
{
  return k.construct_centroid_3_object()(t);
}

template < class K >
inline
typename K::Point_3
centroid(const typename K::Triangle_3 &t, const K &k)
{
  return k.construct_centroid_3_object()(t);
}

template < class K >
inline
typename K::Point_3
circumcenter(const typename K::Point_3 &p,
             const typename K::Point_3 &q, const K &k)
{
  return k.construct_circumcenter_3_object()(p, q);
}

template < class K >
inline
typename K::Point_3
circumcenter(const typename K::Point_3 &p,
             const typename K::Point_3 &q,
             const typename K::Point_3 &r, const K &k)
{
  return k.construct_circumcenter_3_object()(p, q, r);
}

template < class K >
inline
typename K::Point_3
circumcenter(const typename K::Point_3 &p,
             const typename K::Point_3 &q,
             const typename K::Point_3 &r,
             const typename K::Point_3 &s, const K &k)
{
  return k.construct_circumcenter_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::Point_3
circumcenter(const typename K::Tetrahedron_3 &t, const K& k)
{
  return k.construct_circumcenter_3_object()(t);
}

template < class K >
inline
typename K::Point_3
circumcenter(const typename K::Triangle_3 &t, const K& k)
{
  return k.construct_circumcenter_3_object()(t);
}

template < class K >
inline
typename K::Boolean
collinear(const typename K::Point_3 &p,
          const typename K::Point_3 &q,
          const typename K::Point_3 &r,
          const K& k)
{
  return k.collinear_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
collinear_are_ordered_along_line(
          const typename K::Point_3 &p,
          const typename K::Point_3 &q,
          const typename K::Point_3 &r,
          const K& k)
{
  return k.collinear_are_ordered_along_line_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
collinear_are_strictly_ordered_along_line(
          const typename K::Point_3 &p,
          const typename K::Point_3 &q,
          const typename K::Point_3 &r,
          const K& k)
{
  return k.collinear_are_strictly_ordered_along_line_3_object()(p, q, r);
}


template < class K >
inline
typename K::Comparison_result
compare_dihedral_angle(const typename K::Point_3& a1,
                       const typename K::Point_3& b1, 
                       const typename K::Point_3& c1,
                       const typename K::Point_3& d1, 
                       const typename K::Point_3& a2, 
                       const typename K::Point_3& b2, 
                       const typename K::Point_3& c2,
                       const typename K::Point_3& d2,
                       const K& k)
{
  return k.compare_dihedral_angle_3_object()(a1, b1, c1, d1, a2, b2, c2, d2);
}

template < class K >
inline
typename K::Comparison_result
compare_dihedral_angle(const typename K::Point_3& a1,
                       const typename K::Point_3& b1, 
                       const typename K::Point_3& c1,
                       const typename K::Point_3& d1, 
                       const typename K::FT& cosine,
                       const K& k)
{
  return k.compare_dihedral_angle_3_object()(a1, b1, c1, d1, cosine);
}

template < class K >
inline
typename K::Comparison_result
compare_dihedral_angle(const typename K::Vector_3& ab1, 
                       const typename K::Vector_3& ac1,
                       const typename K::Vector_3& ad1,
                       const typename K::Vector_3& ab2,
                       const typename K::Vector_3& ac2,
                       const typename K::Vector_3& ad2,
                       const K& k)
{
  return k.compare_dihedral_angle_3_object()(ab1, ac1, ad1, ab2, ac2, ad2);
}

template < class K >
inline
typename K::Comparison_result
compare_dihedral_angle(const typename K::Vector_3& ab1, 
                       const typename K::Vector_3& ac1,
                       const typename K::Vector_3& ad1,
                       const typename K::FT& cosine,
                       const K& k)
{
  return k.compare_dihedral_angle_3_object()(ab1, ac1, ad1, cosine);
}

template < class K >
inline
typename K::Comparison_result
compare_distance_to_point(const typename K::Point_3 &p,
                          const typename K::Point_3 &q,
                          const typename K::Point_3 &r,
			  const K& k)
{
  return k.compare_distance_3_object()(p, q, r);
}

template < class K >
inline
typename K::Comparison_result
compare_squared_distance(const typename K::Point_3 &p,
                         const typename K::Point_3 &q,
                         const typename K::FT &d2,
		         const K& k)
{
  return k.compare_squared_distance_3_object()(p, q, d2);
}

template < class K >
inline
typename K::Comparison_result
compare_squared_radius(const typename K::Point_3 &p,
		       const typename K::FT &sr,
		       const K& k)
{
  return k.compare_squared_radius_3_object()(p, sr);
}

template < class K >
inline
typename K::Comparison_result
compare_squared_radius(const typename K::Point_3 &p,
		       const typename K::Point_3 &q,
		       const typename K::FT &sr,
		       const K& k)
{
  return k.compare_squared_radius_3_object()(p, q, sr);
}

template < class K >
inline
typename K::Comparison_result
compare_squared_radius(const typename K::Point_3 &p,
		       const typename K::Point_3 &q,
		       const typename K::Point_3 &r,
		       const typename K::FT &sr,
		       const K& k)
{
  return k.compare_squared_radius_3_object()(p, q, r, sr);
}

template < class K >
inline
typename K::Comparison_result
compare_squared_radius(const typename K::Point_3 &p,
		       const typename K::Point_3 &q,
		       const typename K::Point_3 &r,
		       const typename K::Point_3 &s,
		       const typename K::FT &sr,
		       const K& k)
{
  return k.compare_squared_radius_3_object()(p, q, r, s, sr);
}

template < class K >
inline
typename K::Comparison_result
compare_lexicographically_xyz(const typename K::Point_3 &p,
                              const typename K::Point_3 &q,
			      const K& k)
{
  return k.compare_xyz_3_object()(p, q);
}

template < class K >
inline
typename K::Comparison_result
compare_signed_distance_to_plane(const typename K::Plane_3 &h,
				 const typename K::Point_3 &p,
				 const typename K::Point_3 &q,
				 const K &k)
{ 
  if (k.less_signed_distance_to_plane_3_object()(h, p, q)) return SMALLER;
  if (k.less_signed_distance_to_plane_3_object()(h, q, p)) return LARGER;
  return EQUAL;
}

template < class K >
inline
typename K::Comparison_result
compare_signed_distance_to_plane(const typename K::Point_3 &hp,
				 const typename K::Point_3 &hq,
				 const typename K::Point_3 &hr,
				 const typename K::Point_3 &p,
				 const typename K::Point_3 &q,
				 const K &k)
{ 
  if (k.less_signed_distance_to_plane_3_object()(hp, hq, hr, p, q))
    return SMALLER;
  if (k.less_signed_distance_to_plane_3_object()(hp, hq, hr, q, p))
    return LARGER;
  return EQUAL;
}

template < class K >
inline
typename K::Comparison_result
compare_x(const typename K::Point_3 &p,
	  const typename K::Point_3 &q,
	  const K &k)
{ 
  return k.compare_x_3_object()(p, q);
}

template < class K >
inline
typename K::Comparison_result
compare_y(const typename K::Point_3 &p,
	  const typename K::Point_3 &q,
	  const K &k)
{ 
  return k.compare_y_3_object()(p, q);
}

template < class K >
inline
typename K::Comparison_result
compare_z(const typename K::Point_3 &p,
	  const typename K::Point_3 &q,
	  const K &k)
{ 
  return k.compare_z_3_object()(p, q);
}

template < class K >
inline
typename K::Comparison_result
compare_xyz(const typename K::Point_3 &p,
	    const typename K::Point_3 &q,
	    const K &k)
{ 
  return k.compare_xyz_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
coplanar(const typename K::Point_3 &p,
         const typename K::Point_3 &q,
         const typename K::Point_3 &r,
         const typename K::Point_3 &s, const K& k)
{
  return k.coplanar_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::Orientation
coplanar_orientation(const typename K::Point_3 &p,
                     const typename K::Point_3 &q,
                     const typename K::Point_3 &r,
                     const typename K::Point_3 &s, const K& k)
{
  return k.coplanar_orientation_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::Orientation
coplanar_orientation(const typename K::Point_3 &p,
                     const typename K::Point_3 &q,
                     const typename K::Point_3 &r, const K& k)
{
  return k.coplanar_orientation_3_object()(p, q, r);
}

template < class K >
inline
typename K::Bounded_side
coplanar_side_of_bounded_circle(const typename K::Point_3 &p,
                                const typename K::Point_3 &q,
                                const typename K::Point_3 &r,
                                const typename K::Point_3 &t,
                                const K& k)
{
  return k.coplanar_side_of_bounded_circle_3_object()(p, q, r, t);
}

template < class K >
inline
typename K::Vector_3
cross_product(const typename K::Vector_3 &v,
              const typename K::Vector_3 &w, const K& k)
{
  return k.construct_cross_product_vector_3_object()(v, w);
}

template < class K >
inline
typename K::FT
determinant(const typename K::Vector_3 &v0,
            const typename K::Vector_3 &v1,
            const typename K::Vector_3 &v2, const K &k)
{
  return k.compute_determinant_3_object()(v0, v1, v2);
}

template < class K >
inline
typename K::Line_3
equidistant_line(const typename K::Point_3 &p,
                 const typename K::Point_3 &q,
                 const typename K::Point_3 &r, const K& k)
{
  return k.construct_equidistant_line_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
has_smaller_distance_to_point(const typename K::Point_3 &p,
                              const typename K::Point_3 &q,
                              const typename K::Point_3 &r,
			      const K &k)
{
  return k.less_distance_to_point_3_object()(p, q, r);
}

template < class K >
inline
typename K::Boolean
has_larger_distance_to_point(const typename K::Point_3 &p,
			     const typename K::Point_3 &q,
			     const typename K::Point_3 &r,
			     const K &k)
{
  return k.compare_distance_3_object()(p, q, r) == LARGER;
}

template < class K >
inline
typename K::Boolean
has_larger_signed_distance_to_plane(const typename K::Plane_3 &h,
				    const typename K::Point_3 &p,
				    const typename K::Point_3 &q,
				    const K &k)
{ 
  return k.less_signed_distance_to_plane_3_object()(h, q, p);
}

template < class K >
inline
typename K::Boolean
has_larger_signed_distance_to_plane(const typename K::Point_3 &hp,
				    const typename K::Point_3 &hq,
				    const typename K::Point_3 &hr,
				    const typename K::Point_3 &p,
				    const typename K::Point_3 &q,
				    const K &k)
{ 
  return k.less_signed_distance_to_plane_3_object()(hp, hq, hr, q, p);
}

template < class K >
inline
typename K::Boolean
has_smaller_signed_distance_to_plane(const typename K::Plane_3 &h,
                                     const typename K::Point_3 &p,
                                     const typename K::Point_3 &q,
				     const K &k)
{ 
  return k.less_signed_distance_to_plane_3_object()(h, p, q);
}

template < class K >
inline
typename K::Boolean
has_smaller_signed_distance_to_plane(const typename K::Point_3 &hp,
                                     const typename K::Point_3 &hq,
                                     const typename K::Point_3 &hr,
                                     const typename K::Point_3 &p,
                                     const typename K::Point_3 &q,
				     const K &k)
{ 
  return k.less_signed_distance_to_plane_3_object()(hp, hq, hr, p, q);
}

template < class K >
inline
typename K::Boolean
less_x(const typename K::Point_3 &p,
       const typename K::Point_3 &q,
       const K &k)
{ 
  return k.less_x_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
less_y(const typename K::Point_3 &p,
       const typename K::Point_3 &q,
       const K &k)
{ 
  return k.less_y_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
less_z(const typename K::Point_3 &p,
       const typename K::Point_3 &q,
       const K &k)
{ 
  return k.less_z_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
lexicographically_xyz_smaller(const typename K::Point_3 &p,
                              const typename K::Point_3 &q,
                              const K &k)
{
  return k.less_xyz_3_object()(p, q);
}

template < class K >
inline
typename K::Point_3
midpoint(const typename K::Point_3 &p,
         const typename K::Point_3 &q, const K &k)
{
  return k.construct_midpoint_3_object()(p, q);
}

template < class K >
inline
typename K::Point_3
max_vertex(const typename K::Iso_cuboid_3 &ic, const K &k)
{
  return k.construct_max_vertex_3_object()(ic);
}

template < class K >
inline
typename K::Point_3
min_vertex(const typename K::Iso_cuboid_3 &ic, const K &k)
{
  return k.construct_min_vertex_3_object()(ic);
}

template < class K >
inline
typename K::Vector_3
normal(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, const K &k)
{
  return k.construct_normal_3_object()(p, q, r);
}
template < class K >
inline
typename K::Vector_3
unit_normal(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, const K &k)
{
  return k.construct_unit_normal_3_object()(p, q, r);
}

template <class K >
inline
typename K::Orientation
orientation(const typename K::Point_3 &p,
	    const typename K::Point_3 &q,
	    const typename K::Point_3 &r,
	    const typename K::Point_3 &s, const K &k)
{
  return k.orientation_3_object()(p, q, r, s);
}

template <class K >
inline
typename K::Orientation
orientation(const typename K::Vector_3 &u,
	    const typename K::Vector_3 &v,
	    const typename K::Vector_3 &w, const K &k)
{
  return k.orientation_3_object()(u, v, w);
}

template < class K >
inline
typename K::Vector_3
orthogonal_vector(const typename K::Point_3 &p,
		  const typename K::Point_3 &q,
		  const typename K::Point_3 &r, const K &k)
{
  return k.construct_orthogonal_vector_3_object()(p, q, r);
}

template < class K >
inline
typename K::Vector_3
orthogonal_vector(const typename K::Plane_3 &p, const K &k)
{
  return k.construct_orthogonal_vector_3_object()(p);
}

template <typename K>
inline
typename K::Boolean
parallel(const typename K::Line_3 &l1,
         const typename K::Line_3 &l2, const K &k)
{
  return k.are_parallel_3_object()(l1, l2);
}

template <typename K>
inline
typename K::Boolean
parallel(const typename K::Plane_3 &h1,
         const typename K::Plane_3 &h2, const K &k)
{
  return k.are_parallel_3_object()(h1, h2);
}

template <typename K>
inline
typename K::Boolean
parallel(const typename K::Ray_3 &r1,
         const typename K::Ray_3 &r2, const K &k)
{
  return k.are_parallel_3_object()(r1, r2);
}

template <typename K>
inline
typename K::Boolean
parallel(const typename K::Segment_3 &s1,
         const typename K::Segment_3 &s2, const K &k)
{
  return k.are_parallel_3_object()(s1, s2);
}

template <class K >
inline
typename K::Bounded_side
side_of_bounded_sphere(const typename K::Point_3 &p,
                       const typename K::Point_3 &q,
                       const typename K::Point_3 &test, const K &k)
{
  return k.side_of_bounded_sphere_3_object()(p, q, test);
}

template <class K >
inline
typename K::Bounded_side
side_of_bounded_sphere(const typename K::Point_3 &p,
                       const typename K::Point_3 &q,
                       const typename K::Point_3 &r,
                       const typename K::Point_3 &test, const K &k)
{
  return k.side_of_bounded_sphere_3_object()(p, q, r, test);
}

template <class K >
inline
typename K::Bounded_side
side_of_bounded_sphere(const typename K::Point_3 &p,
                       const typename K::Point_3 &q,
                       const typename K::Point_3 &r,
                       const typename K::Point_3 &s,
                       const typename K::Point_3 &test, const K &k)
{
  return k.side_of_bounded_sphere_3_object()(p, q, r, s, test);
}

template <class K >
inline
typename K::Oriented_side
side_of_oriented_sphere(const typename K::Point_3 &p,
                        const typename K::Point_3 &q,
                        const typename K::Point_3 &r,
                        const typename K::Point_3 &s,
                        const typename K::Point_3 &test, const K &k)
{
  return k.side_of_oriented_sphere_3_object()(p, q, r, s, test);
}

template <typename K>
inline
typename K::FT
squared_area(const typename K::Point_3 &p,
	     const typename K::Point_3 &q,
	     const typename K::Point_3 &r, const K &k)
{
  return k.compute_squared_area_3_object()(p, q, r);
}

template < class K >
inline
typename K::FT
squared_radius(const typename K::Point_3 &p,
	       const typename K::Point_3 &q,
	       const typename K::Point_3 &r,
	       const typename K::Point_3 &s, const K &k)
{
  return k.compute_squared_radius_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::FT
squared_radius(const typename K::Point_3 &p,
	       const typename K::Point_3 &q,
	       const typename K::Point_3 &r, const K &k)
{
  return k.compute_squared_radius_3_object()(p, q, r);
}

template < class K >
inline
typename K::FT
squared_radius(const typename K::Point_3 &p,
	       const typename K::Point_3 &q, const K &k)
{
  return k.compute_squared_radius_3_object()(p, q);
}

template < class K >
inline
typename K::FT
squared_radius(const typename K::Point_3 &p, const K &k)
{
  return k.compute_squared_radius_3_object()(p);
}

template < class K >
inline
typename K::FT
volume(const typename K::Point_3 &p,
       const typename K::Point_3 &q,
       const typename K::Point_3 &r,
       const typename K::Point_3 &s, const K &k)
{
  return k.compute_volume_3_object()(p, q, r, s);
}

template < class K >
inline
typename K::Boolean
x_equal(const typename K::Point_3 &p,
        const typename K::Point_3 &q, const K &k)
{
  return k.equal_x_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
y_equal(const typename K::Point_3 &p,
        const typename K::Point_3 &q, const K &k)
{
  return k.equal_y_3_object()(p, q);
}

template < class K >
inline
typename K::Boolean
z_equal(const typename K::Point_3 &p,
        const typename K::Point_3 &q, const K &k)
{
  return k.equal_z_3_object()(p, q);
}


// The following functions only call some of the previous ones.

template <typename K>
inline
typename K::Boolean
are_negative_oriented(const typename K::Point_3 &p,
                      const typename K::Point_3 &q,
                      const typename K::Point_3 &r,
                      const typename K::Point_3 &s, const K &k)
{
  return internal::orientation(p, q, r, s, k) == NEGATIVE;
}

template <typename K>
inline
typename K::Boolean
are_positive_oriented(const typename K::Point_3 &p,
                      const typename K::Point_3 &q,
                      const typename K::Point_3 &r,
                      const typename K::Point_3 &s, const K &k)
{
  return internal::orientation(p, q, r, s, k) == POSITIVE;
}

template < class K >
inline
typename K::Boolean
lexicographically_xyz_smaller_or_equal(const typename K::Point_3 &p,
                                       const typename K::Point_3 &q,
                                       const K&k)
{
  return internal::compare_lexicographically_xyz(p, q, k) != LARGER;
}

} // namespace internal

CGAL_END_NAMESPACE

#endif  // CGAL_KERNEL_GLOBAL_FUNCTIONS_INTERNAL_3_H
