Struct cp_library_rs::geometry::basic::Line
source · pub struct Line(pub Point, pub Point);
Expand description
直線(2次元平面)
Tuple Fields§
§0: Point
§1: Point
Implementations§
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
と直線の距離を求める