幾何ライブラリ [詳解]
クラス | |
struct | Circle |
円 [詳解] | |
struct | Line |
直線 [詳解] | |
struct | Point |
2次元平面上の位置ベクトル [詳解] | |
struct | Segment |
線分 [詳解] | |
型定義 | |
using | Real = long double |
列挙型 | |
enum | Orientation { COUNTER_CLOCKWISE , CLOCKWISE , ONLINE_BACK , ONLINE_FRONT , ON_SEGMENT } |
関数 | |
bool | almostEqual (Real a, Real b) |
bool | lessThan (Real a, Real b) |
bool | greaterThan (Real a, Real b) |
bool | lessThanOrEqual (Real a, Real b) |
bool | greaterThanOrEqual (Real a, Real b) |
Orientation | ccw (const Point &p0, const Point &p1, const Point &p2) |
3点 p0, p1, p2 の進行方向を返す | |
string | orientationToString (Orientation o) |
Point | projection (const Point &p1, const Point &p2, const Point &p) |
ベクトル p の直線 p1, p2 への正射影ベクトルを返す | |
Point | projection (const Line &l, const Point &p) |
ベクトル p の直線 l への正射影ベクトルを返す | |
Point | reflection (const Point &p1, const Point &p2, const Point &p) |
ベクトル p の直線 p1, p2 に対する鏡像ベクトルを返す | |
Point | reflection (const Line &l, const Point &p) |
ベクトル p の直線 l に対する鏡像ベクトルを返す | |
bool | isParallel (const Line &l1, const Line &l2) |
bool | isOrthogonal (const Line &l1, const Line &l2) |
bool | isParallel (const Segment &l1, const Segment &l2) |
bool | isOrthogonal (const Segment &l1, const Segment &l2) |
bool | isParallel (const Line &l1, const Segment &l2) |
bool | isOrthogonal (const Line &l1, const Segment &l2) |
bool | isParallel (const Segment &l1, const Line &l2) |
bool | isOrthogonal (const Segment &l1, const Line &l2) |
bool | isPointOnLine (const Point &p, const Line &l) |
bool | isPointOnSegment (const Point &p, const Segment &s) |
bool | isIntersecting (const Segment &s1, const Segment &s2) |
Point | getIntersection (const Segment &s1, const Segment &s2) |
Real | distancePointToSegment (const Point &p, const Segment &s) |
Real | distanceSegmentToSegment (const Segment &s1, const Segment &s2) |
Real | getPolygonArea (const vector< Point > &points) |
bool | isConvex (const vector< Point > &points) |
bool | isPointOnPolygon (const vector< Point > &polygon, const Point &p) |
bool | isPointInsidePolygon (const vector< Point > &polygon, const Point &p) |
vector< Point > | convexHull (vector< Point > &points, bool include_collinear=false) |
Real | convexHullDiameter (const vector< Point > &hull) |
vector< Point > | cutPolygon (const vector< Point > &g, const Line &l) |
Real | closestPair (vector< Point > &points, int l, int r) |
int | countIntersections (vector< Segment >segments) |
int | countCirclesIntersection (const Circle &c1, const Circle &c2) |
Circle | getInCircle (const Point &A, const Point &B, const Point &C) |
Circle | getCircumCircle (const Point &A, const Point &B, const Point &C) |
vector< Point > | getCircleLineIntersection (const Circle &c, Point p1, Point p2) |
vector< Point > | getCirclesIntersect (const Circle &c1, const Circle &c2) |
vector< Point > | getTangentLinesFromPoint (const Circle &c, const Point &p) |
vector< Segment > | getCommonTangentsLine (const Circle &c1, const Circle &c2) |
変数 | |
const Real | EPS =1e-9 |
幾何ライブラリ
using Geometry::Real = long double |
参照先 almostEqual().
参照先 almostEqual().
参照先 almostEqual().
参照先 almostEqual().
Orientation Geometry::ccw | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2 ) |
3点 p0, p1, p2 の進行方向を返す
参照先 CLOCKWISE, COUNTER_CLOCKWISE, Geometry::Point::cross(), Geometry::Point::dot(), greaterThan(), lessThan(), Geometry::Point::norm(), ON_SEGMENT, ONLINE_BACK, ONLINE_FRONT, Geometry::Point::operator-().
string Geometry::orientationToString | ( | Orientation | o | ) |
ベクトル p の直線 p1, p2 への正射影ベクトルを返す
参照先 Geometry::Point::dot(), Geometry::Point::norm(), Geometry::Point::operator*(), Geometry::Point::operator+(), Geometry::Point::operator-().
ベクトル p の直線 l への正射影ベクトルを返す
参照先 Geometry::Line::a, Geometry::Line::b, Geometry::Point::dot(), Geometry::Point::norm(), Geometry::Point::operator*(), Geometry::Point::operator+(), Geometry::Point::operator-().
ベクトル p の直線 p1, p2 に対する鏡像ベクトルを返す
参照先 Geometry::Point::operator*(), Geometry::Point::operator-(), projection().
ベクトル p の直線 l に対する鏡像ベクトルを返す
参照先 Geometry::Point::operator*(), Geometry::Point::operator-(), projection().
bool Geometry::isConvex | ( | const vector< Point > & | points | ) |
参照先 isPointOnSegment().
int Geometry::countIntersections | ( | vector< Segment > | segments | ) |