Documentation ¶
Index ¶
- Constants
- func Angle(a, b, c Point) float64
- func AreaCircleCircle(ac1, ac2 Circle) float64
- func AreaPolygon(P []Point) float64
- func AreaPolygonCircle(P []Point, c Circle) float64
- func Arg(p Point) float64
- func Ccw(a, b, c Point) int
- func ClosestPair(P []Point) float64
- func Contains(P []Point, q Point) int
- func ConvexDiameter(P []Point) (maxDist float64, mi, mj int)
- func Cross(p, q Point) float64
- func DegreeToRadian(d float64) float64
- func DistanceLineLine(l, m Line) float64
- func DistanceLinePoint(l Line, p Point) float64
- func DistanceLineSegment(l Line, s Segment) float64
- func DistancePointPoint(a, b Point) float64
- func DistanceSegmentPoint(s Segment, p Point) float64
- func DistanceSegmentSegment(a, b Segment) float64
- func Dot(p, q Point) float64
- func IsConvex(P []Point) bool
- func IsIntersectCircleCircle(c1, c2 Circle) int
- func IsIntersectCircleLine(c Circle, l Line) bool
- func IsIntersectCirclePoint(c Circle, p Point) bool
- func IsIntersectCircleSegment(c Circle, s Segment) int
- func IsIntersectLineLine(l, m Line) bool
- func IsIntersectLinePoint(l Line, p Point) bool
- func IsIntersectLineSegment(l Line, s Segment) bool
- func IsIntersectSegmentPoint(s Segment, p Point) bool
- func IsIntersectSegmentSegment(s, t Segment) bool
- func IsOrthogonal(a, b Line) bool
- func IsParallel(a, b Line) bool
- func RadianToDegree(r float64) float64
- type Circle
- type Line
- type Point
- func Conj(p Point) Point
- func ConvexCut(U []Point, l Line) []Point
- func ConvexHull(P []Point) []Point
- func CrossPointLineLine(l, m Line) Point
- func CrossPointSegmentSegment(l, m Segment) Point
- func CrossPointsCircleCircle(c1, c2 Circle) [2]Point
- func CrossPointsCircleLine(c Circle, l Line) [2]Point
- func CrossPointsCircleSegment(c Circle, l Segment) [2]Point
- func NewPoint(x, y float64) Point
- func ProjectionToLine(l Line, p Point) Point
- func ProjectionToSegment(l Segment, p Point) Point
- func Reflection(l Line, p Point) Point
- func Rotate90(p Point) Point
- func RotateTheta(t float64, p Point) Point
- func TangentCirclePoint(c1 Circle, p2 Point) [2]Point
- type Segment
Constants ¶
const ( G_EPS = 1e-10 G_PI = math.Pi G_ONLINE_FRONT = -2 G_CLOCKWISE = -1 G_ON_SEGMENT = 0 G_COUNTER_CLOCKWISE = 1 G_ONLINE_BACK = 2 G_OUT = 0 G_ON = 1 G_IN = 2 )
Variables ¶
This section is empty.
Functions ¶
func AreaCircleCircle ¶
originated from: https://onlinejudge.u-aizu.ac.jp/solutions/problem/CGL_7_I/review/4554366/beet/C++14
func AreaPolygonCircle ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_H 円と多角形の共通部分の面積
func ConvexDiameter ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_4_B 凸多角形の直径(最遠頂点対間距離)
func DegreeToRadian ¶
func DistanceLineLine ¶
func DistanceLinePoint ¶
func DistanceLineSegment ¶
func DistancePointPoint ¶
func DistanceSegmentPoint ¶
func IsIntersectCircleCircle ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_A&lang=jp
func IsIntersectCircleLine ¶
func IsIntersectCirclePoint ¶
func IsIntersectLineLine ¶
func IsIntersectLineSegment ¶
func IsIntersectSegmentPoint ¶
func RadianToDegree ¶
Types ¶
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
func IncircleOfTriangle ¶
return NewCircle(NewPoint(p.x, p.y), r) }
内接円 http://prognote.web.fc2.com/win_c_cpp/tri_incircle/index.html
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
func TangentCircleCircle ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_G 円 c1, c2 の共通接線
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func ConvexCut ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_4_C 凸多角形の切断 直線 l.a-l.b で切断しその左側にできる凸多角形を返す
func CrossPointLineLine ¶
func ProjectionToLine ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_A 射影 直線 l に p から垂線を引いた交点を求める
func ProjectionToSegment ¶
func Reflection ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_B 反射 直線 l を対称軸として点 p と線対称にある点を求める
func RotateTheta ¶
func TangentCirclePoint ¶
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_F 点 p を通る円 c の接線