1.10
Public Types | Public Member Functions | List of all members
CircleType< Dim > Class Template Reference

A basic circle with a center point and radius. More...

#include <geometry.h>

Inheritance diagram for CircleType< Dim >:
Inheritance graph
[legend]

Public Types

using DimType = Dim
 Helper to reference the dimension type.
 
- Public Types inherited from ArcType< Dim >
using DimType = Dim
 Helper to reference the dimension type.
 

Public Member Functions

constexpr CircleType (const PointType< Dim > &center={}, Dim radius={}) noexcept
 Construct a Circle object.
 
template<class T >
PointType< Dim > point_on_circumference (T angle) const noexcept
 Return the point on the circumference of the circle at the given angle.
 
EGT_NODISCARD constexpr RectType< Dim > rect () const noexcept
 Get a Rect that covers the circle.
 
- Public Member Functions inherited from ArcType< Dim >
constexpr ArcType (const PointType< Dim > &center={}, Dim radius={}, float angle1=0.0f, float angle2=0.0f) noexcept
 Construct an Arc object.
 
EGT_NODISCARD constexpr float angle1 () const noexcept
 Get the angle1.
 
constexpr void angle1 (float angle) noexcept
 Set the angle1.
 
EGT_NODISCARD constexpr float angle2 () const noexcept
 Get the angle2.
 
constexpr void angle2 (float angle) noexcept
 Set the angle2.
 
EGT_NODISCARD constexpr PointType< Dim > center () const noexcept
 Get the center point.
 
constexpr void center (const PointType< Dim > &center) noexcept
 Set the center point.
 
EGT_NODISCARD EGT_API bool empty () const noexcept
 Returns true if the arc has no radius.
 
EGT_NODISCARD constexpr Dim radius () const noexcept
 Get the radius.
 
constexpr void radius (Dim radius) noexcept
 Set the radius.
 

Additional Inherited Members

- Protected Attributes inherited from ArcType< Dim >
float m_angle1 {}
 Angle of the arc in radians.
 
float m_angle2 {}
 Angle of the arc in radians.
 
PointType< Dim > m_center
 Center point of the arc.
 
Dim m_radius {0}
 Radius of the arc.
 

Detailed Description

template<class Dim>
class egt::v1::CircleType< Dim >

A basic circle with a center point and radius.

Typically Circle, CircleF are used as aliases.

Member Typedef Documentation

◆ DimType

template<class Dim >
using DimType = Dim

Helper to reference the dimension type.

Constructor & Destructor Documentation

◆ CircleType()

template<class Dim >
constexpr CircleType ( const PointType< Dim > &  center = {},
Dim  radius = {} 
)
inlineexplicitconstexprnoexcept

Construct a Circle object.

Parameters
centerCenter point of the arc.
radiusRadius of the arc.

Member Function Documentation

◆ point_on_circumference()

template<class Dim >
template<class T >
PointType< Dim > point_on_circumference ( angle) const
inlinenoexcept

Return the point on the circumference of the circle at the given angle.

Parameters
angleThe angle in radians.

◆ rect()

template<class Dim >
EGT_NODISCARD constexpr RectType< Dim > rect ( ) const
inlineconstexprnoexcept

Get a Rect that covers the circle.