27 const float d = v1.
Cross(v2);
29 const float t1 = v3.
Cross(v2) / d;
30 const float t2 = v3.
Cross(v1) / d;
42 return start + v1 * t1;
55 const float d = v1.
Cross(v2);
57 const float t1 = v3.
Cross(v2) / d;
58 const float t2 = v3.
Cross(v1) / d;
76 assert(intersection !=
nullptr);
82 (*intersection) =
start;
88 (*intersection) =
end;
100 const float d = v1.
Cross(v2);
102 const float t1 = v3.
Cross(v2) / d;
103 const float t2 = v3.
Cross(v1) / d;
115 *intersection =
start + v1 * t1;
Vector2 GetIntersection(const LineSegment2 &other) const
他の線分との交点を求める.
bool CheckAndGetIntersection(const LineSegment2 &other, Vector2 *intersection) const
他の線分と交点が存在しているかどうか調べ,交点を返す関数.
constexpr bool IsParallel(const LineSegment2 &other) const
引数の線分と自身が平行かどうか調べる関数. 全て constexpr 関数で処理できるため非常に高速.
bool HasIntersection(const LineSegment2 &other) const
他の線分と交点が存在しているかどうか調べる関数.
float 型と double 型の定数を提供するクラス.
constexpr float Cross(const Vector2 &other) const noexcept
自分×引数 の外積の結果を返す.