53#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_POINT_2D_H
54#define LASS_GUARDIAN_OF_INCLUSION_PRIM_POINT_2D_H
73 typedef Point2D<T> TSelf;
75 typedef Vector2D<T> TVector;
77 typedef typename TVector::TValue TValue;
78 typedef typename TVector::TParam TParam;
79 typedef typename TVector::TReference TReference;
80 typedef typename TVector::TConstReference TConstReference;
81 typedef typename TVector::TNumTraits TNumTraits;
83 enum { dimension = TVector::dimension };
85 template <
typename U>
struct Rebind
87 typedef Point2D<U> Type;
94 Point2D(TParam x, TParam y);
95 template <
typename U>
explicit Point2D(
const Point2D<U>& other);
96 template <
typename U>
explicit Point2D(
const Vector2D<U>& position);
97 template <
typename U>
explicit Point2D(
const U& x,
const U& y);
99 const TVector position()
const;
100 TConstReference operator[](
size_t index)
const;
101 TReference operator[](
size_t index);
102 TConstReference at(
signed index)
const;
103 TReference at(
signed index);
105 Point2D<T>& operator+=(
const Vector2D<T>& offset);
106 Point2D<T>& operator-=(
const Vector2D<T>& offset);
112template<
typename T>
bool operator==(
const Point2D<T>& a,
const Point2D<T>& b);
113template<
typename T>
bool operator!=(
const Point2D<T>& a,
const Point2D<T>& b);
115template<
typename T> Point2D<T> operator+(
const Point2D<T>& a,
const Vector2D<T>& b);
116template<
typename T> Point2D<T> operator+(
const Vector2D<T>& a,
const Point2D<T>& b);
117template<
typename T> Point2D<T> operator-(
const Point2D<T>& a,
const Vector2D<T>& b);
118template<
typename T> Vector2D<T> operator-(
const Point2D<T>& a,
const Point2D<T>& b);
120template<
typename T>
typename Point2D<T>::TValue distance(
const Point2D<T>& a,
const Point2D<T>& b);
121template<
typename T>
typename Point2D<T>::TValue squaredDistance(
const Point2D<T>& a,
const Point2D<T>& b);
122template<
typename T> Point2D<T> pointwiseMin(
const Point2D<T>& a,
const Point2D<T>& b);
123template<
typename T> Point2D<T> pointwiseMax(
const Point2D<T>& a,
const Point2D<T>& b);
124template<
typename T> Point2D<T>
lerp(
const Point2D<T>& a,
const Point2D<T>& b,
typename Point2D<T>::TParam t);
126template<
typename T> std::ostream& operator<<(std::ostream& stream,
const Point2D<T>& b);
127template<
typename T> io::XmlOStream& operator<<(io::XmlOStream& stream,
const Point2D<T>& b);
128template<
typename T> std::istream& operator>>(std::istream& stream, Point2D<T>& b);
132template<
typename T> T doubleTriangleArea(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c );
133template<
typename T>
bool cw(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c );
134template<
typename T>
bool ccw(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c );
135template<
typename T>
bool weakCw(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c );
136template<
typename T>
bool weakCcw(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c );
137template<
typename T>
bool inCircle(
const Point2D<T>& a,
const Point2D<T>& b,
const Point2D<T>& c,
const Point2D<T>& d );
145#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_POINT_2D
146#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
Output stream for writing a selection of geometric primitives to matlab M files.
T lerp(const T &a, const T &b, const T &f)
linear interpolation between a and b
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
Library for Assembled Shared Sources.