pub struct Line(pub Point, pub Point);Expand description
直線(2次元平面)
Tuple Fields§
§0: Point§1: PointImplementations§
Source§impl Line
impl Line
Sourcepub fn projection(&self, p: Point) -> Point
pub fn projection(&self, p: Point) -> Point
射影
(直線lに対して点pから引いた垂線の足)
を求める
Sourcepub fn reflection(&self, p: Point) -> Point
pub fn reflection(&self, p: Point) -> Point
反射
(直線lに対して点pに対称な点)
を求める
Sourcepub fn is_orthogonal(&self, other: &Self) -> bool
pub fn is_orthogonal(&self, other: &Self) -> bool
2直線の直交判定
Sourcepub fn is_parallel(&self, other: &Self) -> bool
pub fn is_parallel(&self, other: &Self) -> bool
2直線の平行判定
Sourcepub fn cross_point(&self, other: &Self) -> Point
pub fn cross_point(&self, other: &Self) -> Point
2直線の交点を求める
戻り値
Point: 交点
Sourcepub fn dist_point(&self, p: Point) -> f64
pub fn dist_point(&self, p: Point) -> f64
点pと直線の距離を求める
Trait Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more