pub struct Line {
pub from: Vector,
pub to: Vector,
}Expand description
直線 (線分)
Fields§
§from: Vector線分の始点
to: Vector線分の終点
Implementations§
Source§impl Line
impl Line
Sourcepub fn projection(self, p: Vector) -> Vector
pub fn projection(self, p: Vector) -> Vector
点pから直線に引いた垂線と直線の交点を求める。
Sourcepub fn reflection(self, p: Vector) -> Vector
pub fn reflection(self, p: Vector) -> Vector
直線を対象軸とした点pと線対称の位置の点を求める。
Sourcepub fn is_orthogonal(self, other: Self, eps: Eps) -> bool
pub fn is_orthogonal(self, other: Self, eps: Eps) -> bool
2つの直線が直交していればtrueを返す。
Sourcepub fn is_parallel(self, other: Self, eps: Eps) -> bool
pub fn is_parallel(self, other: Self, eps: Eps) -> bool
2つの直線が平行していればtrueを返す。
Trait Implementations§
impl Copy for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
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