mirror of https://github.com/CGAL/cgal
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
// revision : $Revision$
|
|
// revision_date : $Date$
|
|
// author(s) : Herve Bronnimann
|
|
|
|
#ifndef CGAL_CARTESIAN_DISTANCE_COMPUTATIONS_D_H
|
|
#define CGAL_CARTESIAN_DISTANCE_COMPUTATIONS_D_H
|
|
|
|
#include <CGAL/Cartesian/redefine_names_d.h>
|
|
#include <CGAL/Cartesian/Point_d.h>
|
|
#include <CGAL/Cartesian/Plane_d.h>
|
|
#include <CGAL/constructions/kernel_ftCd.h>
|
|
|
|
CGAL_BEGIN_NAMESPACE
|
|
|
|
template < class R >
|
|
inline
|
|
typename R::FT
|
|
squared_distance(const PointCd<R CGAL_CTAG> &p,
|
|
const PointCd<R CGAL_CTAG> &q)
|
|
{
|
|
CGAL_kernel_precondition( p.dimension() == q.dimension() );
|
|
return squared_distanceCd(p.begin(),p.end(),q.begin());
|
|
}
|
|
|
|
template < class R >
|
|
inline
|
|
typename R::FT
|
|
scaled_distance_to_plane(const PlaneCd<R CGAL_CTAG> &h,
|
|
const PointCd<R CGAL_CTAG> &p)
|
|
{
|
|
return scaled_distance_to_planeCd(h.begin(),h.end(),p.begin(),p.end());
|
|
}
|
|
|
|
template < class R, class PointIterator >
|
|
inline
|
|
typename R::FT
|
|
scaled_distance_to_plane(const PointIterator &first,
|
|
const PointIterator &last,
|
|
const PointCd<R CGAL_CTAG> &p)
|
|
{
|
|
return scaled_distance_to_planeCd(first,last,p.begin(),p.end(),R());
|
|
}
|
|
|
|
CGAL_END_NAMESPACE
|
|
|
|
#endif // CGAL_CARTESIAN_DISTANCE_COMPUTATIONS_D_H
|