Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
transformations.hpp File Reference

Arithmetic transformations and explicit conversions between primitives. More...

Go to the source code of this file.

Namespaces

namespace  pgl

Functions

template<class LeftNumber, class LeftLabel, class RightNumber, class RightLabel>
constexpr auto pgl::operator- (const Point< LeftNumber, LeftLabel > &left, const Point< RightNumber, RightLabel > &right)
 Translates a point by the opposite of another point.
template<class Number, class Label, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Point< Number, Label > &point, const Scalar &scalar)
 Scales a point by a scalar.
template<class Scalar, class Number, class Label>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Point< Number, Label > &point)
 Scales a point by a scalar written on the left.
template<class Number, class Label, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Point< Number, Label > &point, const Scalar &scalar)
 Divides both coordinates by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Segment< PointType, LabelType > &segment, const Point< TranslationNumber, TranslationLabel > &translation)
 Translates a segment by the opposite of a point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Segment< PointType, LabelType > &segment, const Scalar &scalar)
 Scales a segment by a scalar.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Segment< PointType, LabelType > &segment)
 Scales a segment by a scalar written on the left.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Segment< PointType, LabelType > &segment, const Scalar &scalar)
 Divides both endpoints by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const OrientedSegment< PointType, LabelType > &segment, const Point< TranslationNumber, TranslationLabel > &translation)
 Translates an oriented segment by the opposite of a point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const OrientedSegment< PointType, LabelType > &segment, const Scalar &scalar)
 Scales an oriented segment by a scalar.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const OrientedSegment< PointType, LabelType > &segment)
 Scales an oriented segment by a scalar written on the left.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const OrientedSegment< PointType, LabelType > &segment, const Scalar &scalar)
 Divides both endpoints by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Line< PointType, LabelType > &line, const Point< TranslationNumber, TranslationLabel > &translation)
 Translates a line by the opposite of a point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Line< PointType, LabelType > &line, const Scalar &scalar)
 Scales a line by a scalar.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Line< PointType, LabelType > &line)
 Scales a line by a scalar written on the left.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Line< PointType, LabelType > &line, const Scalar &scalar)
 Divides both defining points by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const OrientedLine< PointType, LabelType > &line, const Point< TranslationNumber, TranslationLabel > &translation)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const OrientedLine< PointType, LabelType > &line, const Scalar &scalar)
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const OrientedLine< PointType, LabelType > &line)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const OrientedLine< PointType, LabelType > &line, const Scalar &scalar)
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Ray< PointType, LabelType > &ray, const Point< TranslationNumber, TranslationLabel > &translation)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Ray< PointType, LabelType > &ray, const Scalar &scalar)
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Ray< PointType, LabelType > &ray)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Ray< PointType, LabelType > &ray, const Scalar &scalar)
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Rectangle< PointType, LabelType > &rectangle, const Point< TranslationNumber, TranslationLabel > &translation)
 Translates a rectangle by the opposite of a point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Rectangle< PointType, LabelType > &rectangle, const Scalar &scalar)
 Scales a rectangle by a scalar.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Rectangle< PointType, LabelType > &rectangle)
 Scales a rectangle by a scalar written on the left.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Rectangle< PointType, LabelType > &rectangle, const Scalar &scalar)
 Divides both rectangle corners by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Triangle< PointType, LabelType > &triangle, const Point< TranslationNumber, TranslationLabel > &translation)
 Returns a copy of a triangle translated by the opposite point.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Triangle< PointType, LabelType > &triangle, const Scalar &scalar)
 Returns a scaled copy of a triangle.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Triangle< PointType, LabelType > &triangle)
 Returns a scaled copy of a triangle with the scalar on the left.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Triangle< PointType, LabelType > &triangle, const Scalar &scalar)
 Returns a copy of a triangle divided by a scalar.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Halfplane< PointType, LabelType > &halfplane, const Point< TranslationNumber, TranslationLabel > &translation)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Halfplane< PointType, LabelType > &halfplane, const Scalar &scalar)
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Halfplane< PointType, LabelType > &halfplane)
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Halfplane< PointType, LabelType > &halfplane, const Scalar &scalar)
template<class Number, class ShapeT>
requires (detail::shapeRank<ShapeT> >= 0 && !RectangleConcept<ShapeT> && !DiskConcept<ShapeT>)
constexpr auto pgl::operator* (const Transformation< Number > &transformation, const ShapeT &shape)
 Applies a transformation to any supported shape.
template<class Number, ShapeConcept ShapeT>
constexpr auto pgl::operator* (const Transformation< Number > &transformation, const ShapeT &shape)
 Applies a transformation to the polymorphic Shape wrapper.

Detailed Description

Arithmetic transformations and explicit conversions between primitives.

Translation, scaling, negation, axis swapping, and cross-primitive conversion