Egrome
 
载入中...
搜索中...
未找到
Point类 参考

点类 更多...

#include <Point.h>

类 Point 继承关系图:
Object

Public 成员函数

 Point (float x=0, float y=0) noexcept
 
float & x () noexcept
 
float & y () noexcept
 
const float & x () const noexcept
 
const float & y () const noexcept
 
Pointoperator= (const Point &other) noexcept
 
Point operator+ (const Point &other) const noexcept
 
Point operator- (const Point &other) const noexcept
 
Point operator* (const float &scale) const noexcept
 
Point operator/ (const float &scale) const noexcept
 
Pointoperator+= (const Point &other) noexcept
 
Pointoperator-= (const Point &other) noexcept
 
Pointoperator*= (const float &scale) noexcept
 
Pointoperator/= (const float &scale) noexcept
 
bool operator== (const Point &other) const noexcept
 
bool operator!= (const Point &other) const noexcept
 
float distance (const Point &other) const noexcept
 计算两点之间的距离
 
bool inside (const Rect &rect) const noexcept
 判断点是否在矩形内,不包含边界
 
- Public 成员函数 继承自 Object
 Object () noexcept
 构造函数
 
virtual ~Object () noexcept
 析构函数
 

详细描述

点类

成员函数说明

◆ distance()

float Point::distance ( const Point & other) const
noexcept

计算两点之间的距离

参数
other另一个点
返回
两点之间的距离

◆ inside()

bool Point::inside ( const Rect & rect) const
noexcept

判断点是否在矩形内,不包含边界

参数
rect矩形
返回
点是否在矩形内

该类的文档由以下文件生成: