distance_line_point.h

Back to Distance

pastel/geometry/distance/

// Description: Distance between a line and a point

#ifndef PASTELGEOMETRY_DISTANCE_LINE_POINT_H
#define PASTELGEOMETRY_DISTANCE_LINE_POINT_H

#include "pastel/geometry/shape/line.h"
#include "pastel/sys/vector.h"

namespace Pastel
{

    //! Euclidean distance between a point and a line.
    /*!
   This is a convenience function which returns
   std::sqrt(distance2(line, point)).
   */
    template <typename Real, integer N>
    Real distance(
        const Line<Real, N>& line,
        const Vector<Real, N>& point);

    //! Squared Euclidean distance between a point and a line.
    template <typename Real, integer N>
    Real distance2(
        const Line<Real, N>& line,
        const Vector<Real, N>& point);

}

#include "pastel/geometry/distance/distance_line_point.hpp"

#endif