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

Declaration of pgl::Disk. More...

#include "shape/triangle.hpp"
#include <array>
#include <cassert>
#include <cmath>
#include <compare>
#include <concepts>
#include <cstddef>
#include <iterator>
#include <numbers>
#include <optional>
#include <vector>
#include <ostream>
#include <type_traits>
#include <utility>
#include <stdexcept>

Go to the source code of this file.

Classes

struct  pgl::Disk< PointType_, TLabel >
 Closed Euclidean disk stored by boundary points plus optional disk label. More...
class  pgl::Disk< PointType_, TLabel >::PointIterator
 Forward iterator over the three boundary points. More...

Namespaces

namespace  pgl

Functions

 pgl::Disk () -> Disk< Point<>, NoLabel >
 Deduces a default disk with Point<> boundary points and no label.
template<class PointType>
 pgl::Disk (PointType, typename PointType::NumberType) -> Disk< PointType, NoLabel >
 Deduces a disk from a center point and a radius.
template<PointConcept PointType>
 pgl::Disk (PointType, PointType, PointType) -> Disk< PointType, NoLabel >
 Deduces a disk from three boundary points.
template<class Number>
 pgl::Disk (Number, Number, Number) -> Disk< Point< Number >, NoLabel >
 Deduces a disk from center coordinates and a radius.
template<class PointType, class LabelType, class TranslationNumber, class TranslationLabel>
constexpr auto pgl::operator- (const Disk< PointType, LabelType > &disk, const Point< TranslationNumber, TranslationLabel > &translation)
 Returns a copy of disk translated by translation.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Disk< PointType, LabelType > &disk, const Scalar &scalar)
 Returns a copy of disk with every boundary point scaled by scalar.
template<class Scalar, class PointType, class LabelType>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator* (const Scalar &scalar, const Disk< PointType, LabelType > &disk)
 Returns a copy of disk with every boundary point scaled by scalar.
template<class PointType, class LabelType, class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr auto pgl::operator/ (const Disk< PointType, LabelType > &disk, const Scalar &scalar)
 Returns a copy of disk with every boundary point divided by scalar.
template<class PointType, class LabelType>
std::ostream & pgl::operator<< (std::ostream &stream, const Disk< PointType, LabelType > &disk)
 Streams a disk as ((p1)(p2)(p3)).

Detailed Description

Declaration of pgl::Disk.

A disk is a closed circle and its interior, stored by three points on its boundary circle rather than by a center and radius. This keeps the representation exact for integral coordinates (the center and radius of an integer-coordinate circle are generally rational), at the cost of computing the center/radius on demand via division.