圆形模板类 更多...
#include <Circle.hpp>
Public 成员函数 | |
| constexpr | Circle (Circle &&)=default |
| constexpr | Circle (const Circle &)=default |
| constexpr | Circle (const Point< T > &origin, T radius) |
| 构造函数 | |
| constexpr | Circle (T x=static_cast< T >(0), T y=static_cast< T >(0), T radius=static_cast< T >(0)) |
| 构造函数 | |
| constexpr auto | area () const |
| 求此圆面积 | |
| constexpr | operator bool () const |
| 转换此类到 bool 值 | |
| template<typename U > requires std::is_arithmetic_v<U> | |
| constexpr | operator Circle< U > () const |
| 转换到另一类型 | |
| constexpr bool | operator! () const |
| 逻辑非运算符重载 | |
| constexpr bool | operator!= (const Circle &other) const |
| 不等于比较运算符重载 | |
| constexpr Circle & | operator= (Circle &&)=default |
| constexpr Circle & | operator= (const Circle &)=default |
| constexpr bool | operator== (const Circle &other) const |
| 等于比较运算符重载 | |
| constexpr Point< T > & | origin () |
| 圆心坐标 | |
| constexpr const Point< T > & | origin () const |
| 圆心坐标的 const 版本 | |
| constexpr auto | perimeter () const |
| 求此圆周长 | |
| constexpr T & | radius () |
| 半径 | |
| constexpr const T & | radius () const |
| 半径的 const 版本 | |
| constexpr T & | x () |
| 圆心 x 坐标 | |
| constexpr const T & | x () const |
| 圆心 x 坐标的 const 版本 | |
| constexpr T & | y () |
| 圆心 y 坐标 | |
| constexpr const T & | y () const |
| 圆心 y 坐标的 const 版本 | |
友元 | |
| std::ostream & | operator<< (std::ostream &os, const Circle &circle) |
| 输出圆的信息 | |
圆形模板类
圆形模板类,用于表示圆形的几何信息,包括圆心和半径
此类是 基础设施库 => 图形数据类型 的一部分
| T | 数值类型,要求为算术类型 |
|
inlineexplicitconstexpr |
构造函数
| x | 圆心 x 坐标 |
| y | 圆心 y 坐标 |
| radius | 半径 |
|
inlineconstexpr |
构造函数
| origin | 圆心坐标 |
| radius | 半径 |
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
求此圆面积
|
inlineexplicitconstexpr |
转换此类到 bool 值
若半径大于 0 或圆心不为空,则返回 true,否则返回 false
|
inlineconstexpr |
转换到另一类型
| U | 目标类型 |
|
inlineconstexpr |
逻辑非运算符重载
相当于转换到 bool 值,然后取反
|
inlineconstexpr |
不等于比较运算符重载
此函数对于浮点数比较是安全的
| other | 另一个圆 |
|
inlineconstexpr |
等于比较运算符重载
此函数对于浮点数比较是安全的
| other | 另一个圆 |
|
inlineconstexpr |
圆心坐标
|
inlineconstexpr |
圆心坐标的 const 版本
|
inlineconstexpr |
求此圆周长
|
inlineconstexpr |
半径
|
inlineconstexpr |
半径的 const 版本
|
inlineconstexpr |
圆心 x 坐标
|
inlineconstexpr |
圆心 x 坐标的 const 版本
|
inlineconstexpr |
圆心 y 坐标
|
inlineconstexpr |
圆心 y 坐标的 const 版本