Documentation ¶
Index ¶
- Variables
- func CoordChan(points []Coord) (ch <-chan Coord)
- func CrossProduct(p, q Coord) (z float64)
- func DotProduct(p, q Coord) (r float64)
- func RectsEqual(r1, r2 Rect) bool
- func RectsIntersect(r1, r2 Rect) bool
- func RectsIntersectStrict(r1, r2 Rect) bool
- func VectorAngle(X, Y Coord) (r float64)
- func VertexAngle(A, B, C Coord) (r float64)
- type Bounded
- type Coord
- func (p Coord) DistanceFrom(q Coord) (d float64)
- func (p Coord) DistanceFromSquared(q Coord) (ds float64)
- func (p *Coord) Equals(oi interface{}) (equals bool)
- func (p Coord) EqualsCoord(q Coord) bool
- func (p *Coord) Hashcode() (hash uint64)
- func (p Coord) Magnitude() (m float64)
- func (p Coord) MagnitudeSquared() (ms float64)
- func (p Coord) Minus(q Coord) (r Coord)
- func (p Coord) Plus(q Coord) (r Coord)
- func (p Coord) QuadMM(q Coord) bool
- func (p Coord) QuadMP(q Coord) bool
- func (p Coord) QuadPM(q Coord) bool
- func (p Coord) QuadPP(q Coord) bool
- func (p *Coord) Rotate(rad float64)
- func (p *Coord) RotateLeft()
- func (p *Coord) RotateRight()
- func (p *Coord) Scale(xfactor, yfactor float64)
- func (p Coord) Times(s float64) (r Coord)
- func (p *Coord) Translate(offset Coord)
- func (p Coord) Unit() (u Coord)
- type Line
- type Path
- func (p *Path) AddVertex(v Coord)
- func (p *Path) Bounds() (bounds *Rect)
- func (p *Path) Clone() (op *Path)
- func (p *Path) Equals(oi interface{}) bool
- func (me *Path) Error(other *Path) (offset Coord, error float64)
- func (p *Path) InsertVertexAfter(v Coord, index int)
- func (p *Path) Length() int
- func (p *Path) Register(op *Path) (offset Coord, match bool)
- func (p *Path) Rotate(rad float64)
- func (p *Path) Scale(xf, yf float64)
- func (p *Path) Translate(offset Coord)
- func (p *Path) Vertices() (v []Coord)
- type Polygon
- func (me *Polygon) Bisect(i, j int) (p1, p2 *Polygon)
- func (p *Polygon) Clone() (op *Polygon)
- func (me *Polygon) ContainsCoord(p Coord) bool
- func (p *Polygon) Equals(oi interface{}) bool
- func (me *Polygon) Error(other *Polygon) (offset Coord, error float64)
- func (p *Polygon) Register(op *Polygon) (offset Coord, match bool)
- func (me *Polygon) Segment(index int) (s *Segment)
- func (me *Polygon) Triangles() (tris []Triangle, ok bool)
- func (me *Polygon) Vertex(index int) (v Coord)
- func (me *Polygon) VertexAngle(index int) (r float64)
- func (me *Polygon) WindingOrder() (winding float64)
- type Rect
- func (r Rect) Bounds() (bounds Rect)
- func (r Rect) Center() (center Coord)
- func (r Rect) ContainsCoord(p Coord) bool
- func (r Rect) ContainsRect(o Rect) bool
- func (r Rect) Equals(oi interface{}) bool
- func (r *Rect) ExpandToContain(ch <-chan Coord)
- func (r *Rect) ExpandToContainCoord(p Coord)
- func (r *Rect) ExpandToContainRect(q Rect)
- func (r Rect) Height() float64
- func (r *Rect) Scale(xf, yf float64)
- func (r Rect) Size() (w, h float64)
- func (r Rect) String() string
- func (r *Rect) Translate(offset Coord)
- func (r Rect) Width() float64
- type Segment
- type Transformable
- type Triangle
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Functions ¶
func CrossProduct ¶
func DotProduct ¶
func RectsEqual ¶
func RectsIntersect ¶
func RectsIntersectStrict ¶
func VectorAngle ¶
func VertexAngle ¶
Types ¶
type Coord ¶
type Coord struct {
X, Y float64
}
func LineIntersection ¶
func (Coord) DistanceFrom ¶
func (Coord) DistanceFromSquared ¶
func (Coord) EqualsCoord ¶
func (Coord) MagnitudeSquared ¶
func (*Coord) RotateLeft ¶
func (p *Coord) RotateLeft()
func (*Coord) RotateRight ¶
func (p *Coord) RotateRight()
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (*Path) InsertVertexAfter ¶
type Polygon ¶
type Polygon struct {
Path
}
func (*Polygon) ContainsCoord ¶
func (*Polygon) VertexAngle ¶
func (*Polygon) WindingOrder ¶
type Rect ¶
type Rect struct {
Min, Max Coord
}
func RectsIntersection ¶
func (Rect) ContainsCoord ¶
func (Rect) ContainsRect ¶
func (*Rect) ExpandToContain ¶
func (*Rect) ExpandToContainCoord ¶
func (*Rect) ExpandToContainRect ¶
type Segment ¶
type Segment struct {
A, B Coord
}
func (*Segment) Extrapolate ¶
func (*Segment) IntersectParameters ¶
type Transformable ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.