Documentation
¶
Index ¶
- Constants
- func Angle(v1, v2 Vector2d) float64
- func Distance(p1, p2 Point2d) float64
- func IntervalDistance(p1min, p1max, p2min, p2max float64) float64
- func PointInPolygon(p Point2d, py Polygon2d) bool
- func PointInRect(p Point2d, r AABB2d) bool
- func ProjectPolygon(axis Vector2d, p Polygon2d) (min float64, max float64)
- func RectRectIntersection(r1 AABB2d, r2 AABB2d) bool
- type AABB2d
- type Point2d
- func Extrapolate(P []Point2d) (*Point2d, error)
- func Intersection(p1, p2 Point2d, v1, v2 Vector2d) (bool, *Point2d)
- func Neville(P []Point2d, ts []float64, t float64) (*Point2d, error)
- func PolygonIntersection(r Polygon2d, p Point2d, v Vector2d) (bool, *Point2d)
- func RectIntersection(r AABB2d, p Point2d, v Vector2d) (bool, bool, *Point2d)
- type Polygon2d
- type Vector2d
- func (v1 Vector2d) Cross(v2 Vector2d) float64
- func (v1 Vector2d) Dot(v2 Vector2d) float64
- func (v Vector2d) Mag() float64
- func (v Vector2d) MagSquared() float64
- func (v Vector2d) Normalize() Vector2d
- func (v Vector2d) PopPop() float64
- func (v1 Vector2d) Rotate(a float64) Vector2d
- func (v Vector2d) Scale(s float64) Vector2d
- func (v Vector2d) ToPoint() Point2d
Constants ¶
View Source
const Deg2rad = math.Pi / 180
View Source
const Epsilon = 1e-7
View Source
const Rad2deg = 180 / math.Pi
Variables ¶
This section is empty.
Functions ¶
func IntervalDistance ¶
func PointInPolygon ¶
func PointInRect ¶
func RectRectIntersection ¶
Types ¶
type AABB2d ¶
A and B represent two opposite corners of axis-aligned boundin box
func AASquareAtPoint ¶
type Point2d ¶
func Extrapolate ¶
explicitly implements Neville's algorithm for three points at very particular parameter values: ts[]{0, 1/3, 2/3}, extrapolate to 1.
func Neville ¶
Implements Neville's Algorithm for a slice of points (P) at parameter values(ts), to parameter value (t). Returns the point and an error
func PolygonIntersection ¶
func RectIntersection ¶
returns collision, inside, point of collision
type Polygon2d ¶
type Vector2d ¶
func PolyPolyIntersection ¶
returns intersect, will intersect, translation.Scale(minimum_interval_distance)
func (Vector2d) MagSquared ¶
Click to show internal directories.
Click to hide internal directories.