pub struct Rectangle {
pub x1: f64,
pub y1: f64,
pub x2: f64,
pub y2: f64,
}Expand description
表示二维平面上的矩形的结构体。
矩形由左上角顶点 (x1, y1) 和右下角顶点 (x2, y2) 定义。
Fields§
§x1: f64左上角顶点的 x 坐标。
y1: f64左上角顶点的 y 坐标。
x2: f64右下角顶点的 x 坐标。
y2: f64右下角顶点的 y 坐标。
Implementations§
Source§impl Rectangle
impl Rectangle
Sourcepub fn point_inside(&self, x: f64, y: f64) -> bool
pub fn point_inside(&self, x: f64, y: f64) -> bool
Sourcepub fn inscribed_circle(&self) -> Circle
pub fn inscribed_circle(&self) -> Circle
Trait Implementations§
impl StructuralPartialEq for Rectangle
Auto Trait Implementations§
impl Freeze for Rectangle
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more