geometry

package
v0.0.0-...-344f55e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2014 License: MIT Imports: 4 Imported by: 12

Documentation

Index

Constants

View Source
const (
	EDGE_FEATURE_SELECTION_CRITERIA = 0.98
	EDGE_FEATURE_EXPANSION_FACTOR   = 0.1
)
View Source
const (
	FEATURE_NOT_INDEXED = -1
	FEATURE_EDGE        = 0
	FEATURE_VERTEX      = 1
)
View Source
const (
	NORMAL = iota
	INFINITE
	FIXED_ANGULAR_VELOCITY
	FIXED_LINEAR_VELOCITY
)
View Source
const (
	INERTIA_CONSTANT = math.Pi/8.0 - 8.0/(9.0*math.Pi)
)

Variables

View Source
var (
	X_AXIS = Vector2{1.0, 0.0}
	Y_AXIS = Vector2{0.0, 1.0}
)
View Source
var INV_3 = 1.0 / 3.0
View Source
var INV_3_SQRT = 1.0 / math.Sqrt(3.0)
View Source
var TWO_PI = 2.0 * math.Pi

Functions

func GetLocation

func GetLocation(point, linePoint1, linePoint2 *Vector2) float64

func GetWinding

func GetWinding(points ...*Vector2) float64

func GetWindingFromList

func GetWindingFromList(points []*Vector2) float64

func IntervalClamp

func IntervalClamp(x, min, max float64) float64

func ReverseSliceVector2

func ReverseSliceVector2(s []*Vector2)

func ReverseWinding

func ReverseWinding(points ...*Vector2)

func ReverseWindingFromList

func ReverseWindingFromList(points []*Vector2)

Types

type AABB

type AABB struct {
	// contains filtered or unexported fields
}

func NewAABBFromAABB

func NewAABBFromAABB(a *AABB) *AABB

func NewAABBFromCenterRadius

func NewAABBFromCenterRadius(center *Vector2, radius float64) *AABB

func NewAABBFromFloats

func NewAABBFromFloats(minX, minY, maxX, maxY float64) *AABB

func NewAABBFromRadius

func NewAABBFromRadius(radius float64) *AABB

func NewAABBFromVector2

func NewAABBFromVector2(min, max *Vector2) *AABB

func (*AABB) ContainsAABB

func (a *AABB) ContainsAABB(a2 *AABB) bool

func (*AABB) ContainsVector2

func (a *AABB) ContainsVector2(v *Vector2) bool

func (*AABB) ContainsXY

func (a *AABB) ContainsXY(x, y float64) bool

func (*AABB) Expand

func (a *AABB) Expand(expansion float64)

func (*AABB) GetArea

func (a *AABB) GetArea() float64

func (*AABB) GetExpanded

func (a *AABB) GetExpanded(expansion float64) *AABB

func (*AABB) GetHeight

func (a *AABB) GetHeight() float64

func (*AABB) GetIntersection

func (a *AABB) GetIntersection(a2 *AABB) *AABB

func (*AABB) GetMaxX

func (a *AABB) GetMaxX() float64

func (*AABB) GetMaxY

func (a *AABB) GetMaxY() float64

func (*AABB) GetMinX

func (a *AABB) GetMinX() float64

func (*AABB) GetMinY

func (a *AABB) GetMinY() float64

func (*AABB) GetPerimeter

func (a *AABB) GetPerimeter() float64

func (*AABB) GetTranslated

func (a *AABB) GetTranslated(translation *Vector2) *AABB

func (*AABB) GetUnion

func (a *AABB) GetUnion(a2 *AABB) *AABB

func (*AABB) GetWidth

func (a *AABB) GetWidth() float64

func (*AABB) Intersection

func (a *AABB) Intersection(a2 *AABB)

func (*AABB) IsDegenerate

func (a *AABB) IsDegenerate() bool

func (*AABB) IsDegenerateWithError

func (a *AABB) IsDegenerateWithError(e float64) bool

func (*AABB) Overlaps

func (a *AABB) Overlaps(a2 *AABB) bool

func (*AABB) String

func (a *AABB) String() string

func (*AABB) Translate

func (a *AABB) Translate(translation *Vector2)

func (*AABB) Union

func (a *AABB) Union(a2 *AABB)

type AbstractShape

type AbstractShape struct {
	// contains filtered or unexported fields
}

func (*AbstractShape) GetCenter

func (a *AbstractShape) GetCenter() *Vector2

func (*AbstractShape) GetID

func (a *AbstractShape) GetID() string

func (*AbstractShape) GetRadius

func (a *AbstractShape) GetRadius() float64

func (*AbstractShape) GetUserData

func (a *AbstractShape) GetUserData() interface{}

func (*AbstractShape) RotateAboutXY

func (a *AbstractShape) RotateAboutXY(theta, x, y float64)

func (*AbstractShape) SetUserData

func (a *AbstractShape) SetUserData(data interface{})

func (*AbstractShape) TranslateXY

func (a *AbstractShape) TranslateXY(x, y float64)

type Capsule

type Capsule struct {
	AbstractShape
	// contains filtered or unexported fields
}

func CreateCapsule

func CreateCapsule(width, height float64) *Capsule

func NewCapsule

func NewCapsule(width, height float64) *Capsule

func ScaleCapsule

func ScaleCapsule(capsule *Capsule, scale float64) *Capsule

func (*Capsule) ContainsVector2

func (c *Capsule) ContainsVector2(v *Vector2) bool

func (*Capsule) ContainsVector2Transform

func (c *Capsule) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Capsule) CreateAABB

func (c *Capsule) CreateAABB() *AABB

func (*Capsule) CreateAABBTransform

func (c *Capsule) CreateAABBTransform(transform *Transform) *AABB

func (*Capsule) CreateMass

func (c *Capsule) CreateMass(density float64) *Mass

func (*Capsule) GetAxes

func (c *Capsule) GetAxes(foci []*Vector2, t *Transform) []*Vector2

func (*Capsule) GetCapRadius

func (c *Capsule) GetCapRadius() float64

func (*Capsule) GetFarthestFeature

func (c *Capsule) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Capsule) GetFarthestPoint

func (c *Capsule) GetFarthestPoint(v *Vector2, t *Transform) *Vector2

func (*Capsule) GetFoci

func (c *Capsule) GetFoci(t *Transform) []*Vector2

func (*Capsule) GetLength

func (c *Capsule) GetLength() float64

func (*Capsule) GetRadiusVector2

func (c *Capsule) GetRadiusVector2(center *Vector2) float64

func (*Capsule) GetRotation

func (c *Capsule) GetRotation() float64

func (*Capsule) ProjectVector2

func (c *Capsule) ProjectVector2(v *Vector2) *Interval

func (*Capsule) ProjectVector2Transform

func (c *Capsule) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Capsule) RotateAboutCenter

func (c *Capsule) RotateAboutCenter(theta float64)

func (*Capsule) RotateAboutOrigin

func (c *Capsule) RotateAboutOrigin(theta float64)

func (*Capsule) RotateAboutVector2

func (c *Capsule) RotateAboutVector2(theta float64, v *Vector2)

func (*Capsule) RotateAboutXY

func (c *Capsule) RotateAboutXY(theta, x, y float64)

func (*Capsule) TranslateVector2

func (c *Capsule) TranslateVector2(v *Vector2)

func (*Capsule) TranslateXY

func (c *Capsule) TranslateXY(x, y float64)

type Circle

type Circle struct {
	AbstractShape
}

func CreateCircle

func CreateCircle(radius float64) *Circle

func NewCircle

func NewCircle(radius float64) *Circle

func ScaleCircle

func ScaleCircle(circle *Circle, scale float64) *Circle

func (*Circle) ContainsVector2

func (c *Circle) ContainsVector2(v *Vector2) bool

func (*Circle) ContainsVector2Transform

func (c *Circle) ContainsVector2Transform(v *Vector2, t *Transform) bool

func (*Circle) CreateAABB

func (c *Circle) CreateAABB() *AABB

func (*Circle) CreateAABBTransform

func (c *Circle) CreateAABBTransform(t *Transform) *AABB

func (*Circle) CreateMass

func (c *Circle) CreateMass(density float64) *Mass

func (*Circle) GetAxes

func (c *Circle) GetAxes(foci []*Vector2, t *Transform) []*Vector2

func (*Circle) GetFarthestFeature

func (c *Circle) GetFarthestFeature(v *Vector2, t *Transform) Featurer

func (*Circle) GetFarthestPoint

func (c *Circle) GetFarthestPoint(v *Vector2, t *Transform) *Vector2

func (*Circle) GetFoci

func (c *Circle) GetFoci(t *Transform) []*Vector2

func (*Circle) GetRadiusVector2

func (c *Circle) GetRadiusVector2(v *Vector2) float64

func (*Circle) ProjectVector2

func (c *Circle) ProjectVector2(v *Vector2) *Interval

func (*Circle) ProjectVector2Transform

func (c *Circle) ProjectVector2Transform(v *Vector2, t *Transform) *Interval

func (*Circle) RotateAboutCenter

func (c *Circle) RotateAboutCenter(theta float64)

func (*Circle) RotateAboutOrigin

func (c *Circle) RotateAboutOrigin(theta float64)

func (*Circle) RotateAboutVector2

func (c *Circle) RotateAboutVector2(theta float64, v *Vector2)

func (*Circle) TranslateVector2

func (c *Circle) TranslateVector2(v *Vector2)

type Convexer

type Convexer interface {
	Shaper
	GetAxes(foci []*Vector2, t *Transform) []*Vector2
	GetFoci(t *Transform) []*Vector2
	GetFarthestFeature(v *Vector2, t *Transform) Featurer
	GetFarthestPoint(v *Vector2, t *Transform) *Vector2
}

type Edge

type Edge struct {
	Feature
	// contains filtered or unexported fields
}

func NewEdge

func NewEdge(vertex1, vertex2, max *Vertex, edge *Vector2, index int) *Edge

func (*Edge) GetEdge

func (e *Edge) GetEdge() *Vector2

func (*Edge) GetIndex

func (e *Edge) GetIndex() int

func (*Edge) GetMaximum

func (e *Edge) GetMaximum() *Vertex

func (*Edge) GetVertex1

func (e *Edge) GetVertex1() *Vertex

func (*Edge) GetVertex2

func (e *Edge) GetVertex2() *Vertex

type Ellipse

type Ellipse struct {
	AbstractShape
	// contains filtered or unexported fields
}

func CreateEllipse

func CreateEllipse(width, height float64) *Ellipse

func NewEllipse

func NewEllipse(width, height float64) *Ellipse

func ScaleEllipse

func ScaleEllipse(ellipse *Ellipse, scale float64) *Ellipse

func (*Ellipse) ContainsVector2

func (e *Ellipse) ContainsVector2(v *Vector2) bool

func (*Ellipse) ContainsVector2Transform

func (e *Ellipse) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Ellipse) CreateAABB

func (e *Ellipse) CreateAABB() *AABB

func (*Ellipse) CreateAABBTransform

func (e *Ellipse) CreateAABBTransform(transform *Transform) *AABB

func (*Ellipse) CreateMass

func (e *Ellipse) CreateMass(density float64) *Mass

func (*Ellipse) GetAxes

func (e *Ellipse) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*Ellipse) GetFarthestFeature

func (e *Ellipse) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Ellipse) GetFarthestPoint

func (e *Ellipse) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Ellipse) GetFoci

func (e *Ellipse) GetFoci(transform *Transform) []*Vector2

func (*Ellipse) GetHalfHeight

func (e *Ellipse) GetHalfHeight() float64

func (*Ellipse) GetHalfWidth

func (e *Ellipse) GetHalfWidth() float64

func (*Ellipse) GetHeight

func (e *Ellipse) GetHeight() float64

func (*Ellipse) GetRadiusVector2

func (e *Ellipse) GetRadiusVector2(center *Vector2) float64

func (*Ellipse) GetRotation

func (e *Ellipse) GetRotation() float64

func (*Ellipse) GetWidth

func (e *Ellipse) GetWidth() float64

func (*Ellipse) ProjectVector2

func (e *Ellipse) ProjectVector2(v *Vector2) *Interval

func (*Ellipse) ProjectVector2Transform

func (e *Ellipse) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Ellipse) RotateAboutCenter

func (e *Ellipse) RotateAboutCenter(theta float64)

func (*Ellipse) RotateAboutOrigin

func (e *Ellipse) RotateAboutOrigin(theta float64)

func (*Ellipse) RotateAboutVector2

func (e *Ellipse) RotateAboutVector2(theta float64, v *Vector2)

func (*Ellipse) RotateAboutXY

func (e *Ellipse) RotateAboutXY(theta, x, y float64)

func (*Ellipse) TranslateVector2

func (e *Ellipse) TranslateVector2(v *Vector2)

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

func (*Feature) IsEdge

func (f *Feature) IsEdge() bool

func (*Feature) IsVertex

func (f *Feature) IsVertex() bool

type Featurer

type Featurer interface {
	IsEdge() bool
	IsVertex() bool
}

func GetFarthestFeature

func GetFarthestFeature(v1, v2, n *Vector2, t *Transform) Featurer

type HalfEllipse

type HalfEllipse struct {
	AbstractShape
	// contains filtered or unexported fields
}

func CreateHalfEllipse

func CreateHalfEllipse(width, height float64) *HalfEllipse

func CreateHalfEllipseAtOrigin

func CreateHalfEllipseAtOrigin(width, height float64) *HalfEllipse

func NewHalfEllipse

func NewHalfEllipse(width, height float64) *HalfEllipse

func ScaleHalfEllipse

func ScaleHalfEllipse(halfEllipse *HalfEllipse, scale float64) *HalfEllipse

func (*HalfEllipse) ContainsVector2

func (h *HalfEllipse) ContainsVector2(v *Vector2) bool

func (*HalfEllipse) ContainsVector2Transform

func (h *HalfEllipse) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*HalfEllipse) CreateAABB

func (h *HalfEllipse) CreateAABB() *AABB

func (*HalfEllipse) CreateAABBTransform

func (h *HalfEllipse) CreateAABBTransform(transform *Transform) *AABB

func (*HalfEllipse) CreateMass

func (h *HalfEllipse) CreateMass(density float64) *Mass

func (*HalfEllipse) GetAxes

func (h *HalfEllipse) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*HalfEllipse) GetEllipseCenter

func (h *HalfEllipse) GetEllipseCenter() *Vector2

func (*HalfEllipse) GetFarthestFeature

func (h *HalfEllipse) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*HalfEllipse) GetFarthestPoint

func (h *HalfEllipse) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*HalfEllipse) GetFoci

func (h *HalfEllipse) GetFoci(transform *Transform) []*Vector2

func (*HalfEllipse) GetHalfWidth

func (h *HalfEllipse) GetHalfWidth() float64

func (*HalfEllipse) GetHeight

func (h *HalfEllipse) GetHeight() float64

func (*HalfEllipse) GetRadiusVector2

func (h *HalfEllipse) GetRadiusVector2(center *Vector2) float64

func (*HalfEllipse) GetRotation

func (h *HalfEllipse) GetRotation() float64

func (*HalfEllipse) GetWidth

func (h *HalfEllipse) GetWidth() float64

func (*HalfEllipse) ProjectVector2

func (h *HalfEllipse) ProjectVector2(v *Vector2) *Interval

func (*HalfEllipse) ProjectVector2Transform

func (h *HalfEllipse) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*HalfEllipse) RotateAboutCenter

func (h *HalfEllipse) RotateAboutCenter(theta float64)

func (*HalfEllipse) RotateAboutOrigin

func (h *HalfEllipse) RotateAboutOrigin(theta float64)

func (*HalfEllipse) RotateAboutVector2

func (h *HalfEllipse) RotateAboutVector2(theta float64, v *Vector2)

func (*HalfEllipse) RotateAboutXY

func (h *HalfEllipse) RotateAboutXY(theta, x, y float64)

func (*HalfEllipse) TranslateVector2

func (h *HalfEllipse) TranslateVector2(v *Vector2)

func (*HalfEllipse) TranslateXY

func (h *HalfEllipse) TranslateXY(x, y float64)

type Interval

type Interval struct {
	// contains filtered or unexported fields
}

func NewIntervalFromInterval

func NewIntervalFromInterval(orig *Interval) *Interval

func NewIntervalFromMinMax

func NewIntervalFromMinMax(min, max float64) *Interval

func (*Interval) Clamp

func (i *Interval) Clamp(x float64) float64

func (*Interval) Contains

func (i *Interval) Contains(i2 *Interval) bool

func (*Interval) Distance

func (i *Interval) Distance(i2 *Interval) float64

func (*Interval) Expand

func (i *Interval) Expand(x float64)

func (*Interval) GetExpanded

func (i *Interval) GetExpanded(x float64) *Interval

func (*Interval) GetIntersection

func (i *Interval) GetIntersection(i2 *Interval) *Interval

func (*Interval) GetLength

func (i *Interval) GetLength() float64

func (*Interval) GetMax

func (i *Interval) GetMax() float64

func (*Interval) GetMin

func (i *Interval) GetMin() float64

func (*Interval) GetOverlap

func (i *Interval) GetOverlap(i2 *Interval) float64

func (*Interval) GetUnion

func (i *Interval) GetUnion(i2 *Interval) *Interval

func (*Interval) IncludesExclusive

func (i *Interval) IncludesExclusive(x float64) bool

func (*Interval) IncludesInclusive

func (i *Interval) IncludesInclusive(x float64) bool

func (*Interval) IncludesInclusiveMax

func (i *Interval) IncludesInclusiveMax(x float64) bool

func (*Interval) IncludesInclusiveMin

func (i *Interval) IncludesInclusiveMin(x float64) bool

func (*Interval) Intersection

func (i *Interval) Intersection(i2 *Interval)

func (*Interval) IsDegenerate

func (i *Interval) IsDegenerate() bool

func (*Interval) IsDegenerateWithError

func (i *Interval) IsDegenerateWithError(e float64) bool

func (*Interval) Overlaps

func (i *Interval) Overlaps(i2 *Interval) bool

func (*Interval) SetMax

func (i *Interval) SetMax(max float64)

func (*Interval) SetMin

func (i *Interval) SetMin(min float64)

func (*Interval) String

func (i *Interval) String() string

func (*Interval) Union

func (i *Interval) Union(i2 *Interval)

type Mass

type Mass struct {
	// contains filtered or unexported fields
}

func CreateMass

func CreateMass(masses []*Mass) *Mass

func NewMass

func NewMass() *Mass

func NewMassFromCenterMassInertia

func NewMassFromCenterMassInertia(center *Vector2, mass, inertia float64) *Mass

func NewMassFromMass

func NewMassFromMass(m *Mass) *Mass

func (*Mass) GetCenter

func (m *Mass) GetCenter() *Vector2

func (*Mass) GetInertia

func (m *Mass) GetInertia() float64

func (*Mass) GetInverseInertia

func (m *Mass) GetInverseInertia() float64

func (*Mass) GetInverseMass

func (m *Mass) GetInverseMass() float64

func (*Mass) GetMass

func (m *Mass) GetMass() float64

func (*Mass) GetType

func (m *Mass) GetType() int

func (*Mass) IsInfinite

func (m *Mass) IsInfinite() bool

func (*Mass) SetType

func (m *Mass) SetType(massType int)

type Matrix22

type Matrix22 struct {
	// contains filtered or unexported fields
}

func NewMatrix22FromFloatSlice

func NewMatrix22FromFloatSlice(values []float64) *Matrix22

func NewMatrix22FromFloats

func NewMatrix22FromFloats(m00, m01, m10, m11 float64) *Matrix22

func NewMatrix22FromMatrix22

func NewMatrix22FromMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) AddMatrix22

func (m *Matrix22) AddMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) Determinant

func (m *Matrix22) Determinant() float64

func (*Matrix22) DifferenceMatrix22

func (m *Matrix22) DifferenceMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) GetInverse

func (m *Matrix22) GetInverse() *Matrix22

func (*Matrix22) GetTranspose

func (m *Matrix22) GetTranspose() *Matrix22

func (*Matrix22) Identity

func (m *Matrix22) Identity() *Matrix22

func (*Matrix22) Invert

func (m *Matrix22) Invert() *Matrix22

func (*Matrix22) MultiplyMatrix22

func (m *Matrix22) MultiplyMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) MultiplyScalar

func (m *Matrix22) MultiplyScalar(s float64) *Matrix22

func (*Matrix22) MultiplyTVector2

func (m *Matrix22) MultiplyTVector2(v *Vector2) *Vector2

func (*Matrix22) MultiplyVector2

func (m *Matrix22) MultiplyVector2(v *Vector2) *Vector2

func (*Matrix22) ProductMatrix22

func (m *Matrix22) ProductMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) ProductScalar

func (m *Matrix22) ProductScalar(s float64) *Matrix22

func (*Matrix22) ProductTVector2

func (m *Matrix22) ProductTVector2(v *Vector2) *Vector2

func (*Matrix22) ProductVector2

func (m *Matrix22) ProductVector2(v *Vector2) *Vector2

func (*Matrix22) Solve

func (m *Matrix22) Solve(v *Vector2) *Vector2

func (*Matrix22) SubtractMatrix22

func (m *Matrix22) SubtractMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) SumMatrix22

func (m *Matrix22) SumMatrix22(m2 *Matrix22) *Matrix22

func (*Matrix22) Transpose

func (m *Matrix22) Transpose() *Matrix22

type Matrix33

type Matrix33 struct {
	// contains filtered or unexported fields
}

func NewMatrix33FromFloatSlice

func NewMatrix33FromFloatSlice(values []float64) *Matrix33

func NewMatrix33FromFloats

func NewMatrix33FromFloats(m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) *Matrix33

func NewMatrix33FromMatrix33

func NewMatrix33FromMatrix33(m2 *Matrix33) *Matrix33

func (*Matrix33) Add

func (m *Matrix33) Add(m2 *Matrix33) *Matrix33

func (*Matrix33) Determinant

func (m *Matrix33) Determinant() float64

func (*Matrix33) Difference

func (m *Matrix33) Difference(m2 *Matrix33) *Matrix33

func (*Matrix33) GetInverse

func (m *Matrix33) GetInverse() *Matrix33

func (*Matrix33) GetTranspose

func (m *Matrix33) GetTranspose() *Matrix33

func (*Matrix33) Identity

func (m *Matrix33) Identity() *Matrix33

func (*Matrix33) Invert

func (m *Matrix33) Invert() *Matrix33

func (*Matrix33) MultiplyMatrix33

func (m *Matrix33) MultiplyMatrix33(m2 *Matrix33) *Matrix33

func (*Matrix33) MultiplyScalar

func (m *Matrix33) MultiplyScalar(s float64) *Matrix33

func (*Matrix33) MultiplyTVector3

func (m *Matrix33) MultiplyTVector3(v *Vector3) *Vector3

func (*Matrix33) MultiplyVector3

func (m *Matrix33) MultiplyVector3(v *Vector3) *Vector3

func (*Matrix33) ProductMatrix33

func (m *Matrix33) ProductMatrix33(m2 *Matrix33) *Matrix33

func (*Matrix33) ProductScalar

func (m *Matrix33) ProductScalar(s float64) *Matrix33

func (*Matrix33) ProductTVector3

func (m *Matrix33) ProductTVector3(v *Vector3) *Vector3

func (*Matrix33) ProductVector3

func (m *Matrix33) ProductVector3(v *Vector3) *Vector3

func (*Matrix33) Solve22

func (m *Matrix33) Solve22(v *Vector2) *Vector2

func (*Matrix33) Solve33

func (m *Matrix33) Solve33(v *Vector3) *Vector3

func (*Matrix33) Subtract

func (m *Matrix33) Subtract(m2 *Matrix33) *Matrix33

func (*Matrix33) Sum

func (m *Matrix33) Sum(m2 *Matrix33) *Matrix33

func (*Matrix33) Transpose

func (m *Matrix33) Transpose() *Matrix33

type Polygon

type Polygon struct {
	Wound
}

func CreatePolygon

func CreatePolygon(vertices ...*Vector2) *Polygon

func CreatePolygonAtOrigin

func CreatePolygonAtOrigin(vertices ...*Vector2) *Polygon

func CreatePolygonalCapsule

func CreatePolygonalCapsule(count int, width, height float64) *Polygon

func CreatePolygonalCircle

func CreatePolygonalCircle(count int, radius float64) *Polygon

func CreatePolygonalCircleTheta

func CreatePolygonalCircleTheta(count int, radius, theta float64) *Polygon

func CreatePolygonalEllipse

func CreatePolygonalEllipse(count int, width, height float64) *Polygon

func CreatePolygonalHalfEllipse

func CreatePolygonalHalfEllipse(count int, width, height float64) *Polygon

func CreatePolygonalHalfEllipseAtOrigin

func CreatePolygonalHalfEllipseAtOrigin(count int, width, height float64) *Polygon

func CreatePolygonalSlice

func CreatePolygonalSlice(count int, radius, theta float64) *Polygon

func CreatePolygonalSliceAtOrigin

func CreatePolygonalSliceAtOrigin(count int, radius, theta float64) *Polygon

func CreateUnitCirclePolygon

func CreateUnitCirclePolygon(count int, radius float64) *Polygon

func CreateUnitCirclePolygonTheta

func CreateUnitCirclePolygonTheta(count int, radius, theta float64) *Polygon

func Flip

func Flip(polygon Wounder, axis *Vector2) *Polygon

func FlipAlongTheXAxis

func FlipAlongTheXAxis(polygon Wounder) *Polygon

func FlipAlongTheXAxisVector2

func FlipAlongTheXAxisVector2(polygon Wounder, point *Vector2) *Polygon

func FlipAlongTheYAxis

func FlipAlongTheYAxis(polygon Wounder) *Polygon

func FlipAlongTheYAxisVector2

func FlipAlongTheYAxisVector2(polygon Wounder, point *Vector2) *Polygon

func FlipVector2

func FlipVector2(polygon Wounder, axis, point *Vector2) *Polygon

func MinkowskiSum

func MinkowskiSum(p1, p2 WounderConvexer) *Polygon

func MinkowskiSumCirclePolygonInt

func MinkowskiSumCirclePolygonInt(circle *Circle, polygon *Polygon, count int) *Polygon

func MinkowskiSumPolygonCircleInt

func MinkowskiSumPolygonCircleInt(polygon *Polygon, circle *Circle, count int) *Polygon

func MinkowskiSumPolygonFloat64Int

func MinkowskiSumPolygonFloat64Int(polygon *Polygon, radius float64, count int) *Polygon

func NewPolygon

func NewPolygon(vertices ...*Vector2) *Polygon

func ScalePolygon

func ScalePolygon(polygon *Polygon, scale float64) *Polygon

func (*Polygon) ContainsVector2

func (p *Polygon) ContainsVector2(v *Vector2) bool

func (*Polygon) ContainsVector2Transform

func (p *Polygon) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Polygon) CreateAABB

func (p *Polygon) CreateAABB() *AABB

func (*Polygon) CreateAABBTransform

func (p *Polygon) CreateAABBTransform(transform *Transform) *AABB

func (*Polygon) CreateMass

func (p *Polygon) CreateMass(density float64) *Mass

func (*Polygon) GetAxes

func (p *Polygon) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*Polygon) GetFarthestFeature

func (p *Polygon) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Polygon) GetFarthestPoint

func (p *Polygon) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Polygon) GetFoci

func (p *Polygon) GetFoci(transform *Transform) []*Vector2

func (*Polygon) ProjectVector2

func (p *Polygon) ProjectVector2(v *Vector2) *Interval

func (*Polygon) ProjectVector2Transform

func (p *Polygon) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Polygon) RotateAboutCenter

func (p *Polygon) RotateAboutCenter(theta float64)

func (*Polygon) RotateAboutOrigin

func (p *Polygon) RotateAboutOrigin(theta float64)

func (*Polygon) RotateAboutVector2

func (p *Polygon) RotateAboutVector2(theta float64, v *Vector2)

func (*Polygon) RotateAboutXY

func (p *Polygon) RotateAboutXY(theta, x, y float64)

func (*Polygon) TranslateVector2

func (p *Polygon) TranslateVector2(v *Vector2)

func (*Polygon) TranslateXY

func (p *Polygon) TranslateXY(x, y float64)

type Ray

type Ray struct {
	// contains filtered or unexported fields
}

func NewRayFromFloat

func NewRayFromFloat(direction float64) *Ray

func NewRayFromVector2

func NewRayFromVector2(direction *Vector2) *Ray

func NewRayFromVector2Float

func NewRayFromVector2Float(start *Vector2, direction float64) *Ray

func NewRayFromVector2Vector2

func NewRayFromVector2Vector2(start, direction *Vector2) *Ray

func (*Ray) GetDirectionFloat

func (r *Ray) GetDirectionFloat() float64

func (*Ray) GetDirectionVector2

func (r *Ray) GetDirectionVector2() *Vector2

func (*Ray) GetStart

func (r *Ray) GetStart() *Vector2

func (*Ray) SetDirectionFloat

func (r *Ray) SetDirectionFloat(direction float64)

func (*Ray) SetDirectionVector2

func (r *Ray) SetDirectionVector2(direction *Vector2)

func (*Ray) SetStart

func (r *Ray) SetStart(start *Vector2)

func (*Ray) String

func (r *Ray) String() string

type Rectangle

type Rectangle struct {
	Polygon
	// contains filtered or unexported fields
}

func CreateRectangle

func CreateRectangle(width, height float64) *Rectangle

func CreateSquare

func CreateSquare(size float64) *Rectangle

func NewRectangle

func NewRectangle(width, height float64) *Rectangle

func (*Rectangle) ContainsVector2

func (r *Rectangle) ContainsVector2(v *Vector2) bool

func (*Rectangle) ContainsVector2Transform

func (r *Rectangle) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Rectangle) CreateAABB

func (r *Rectangle) CreateAABB() *AABB

func (*Rectangle) CreateAABBTransform

func (r *Rectangle) CreateAABBTransform(transform *Transform) *AABB

func (*Rectangle) CreateMass

func (r *Rectangle) CreateMass(density float64) *Mass

func (*Rectangle) GetAxes

func (r *Rectangle) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*Rectangle) GetCenter

func (r *Rectangle) GetCenter() *Vector2

func (*Rectangle) GetFarthestFeature

func (r *Rectangle) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Rectangle) GetFarthestPoint

func (r *Rectangle) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Rectangle) GetFoci

func (r *Rectangle) GetFoci(transform *Transform) []*Vector2

func (*Rectangle) GetHeight

func (r *Rectangle) GetHeight() float64

func (*Rectangle) GetID

func (r *Rectangle) GetID() string

func (*Rectangle) GetNormals

func (r *Rectangle) GetNormals() []*Vector2

func (*Rectangle) GetRotation

func (r *Rectangle) GetRotation() float64

func (*Rectangle) GetUserData

func (r *Rectangle) GetUserData() interface{}

func (*Rectangle) GetVertices

func (r *Rectangle) GetVertices() []*Vector2

func (*Rectangle) GetWidth

func (r *Rectangle) GetWidth() float64

func (*Rectangle) ProjectVector2

func (r *Rectangle) ProjectVector2(v *Vector2) *Interval

func (*Rectangle) ProjectVector2Transform

func (r *Rectangle) ProjectVector2Transform(axis *Vector2, transform *Transform) *Interval

func (*Rectangle) RotateAboutCenter

func (r *Rectangle) RotateAboutCenter(theta float64)

func (*Rectangle) RotateAboutOrigin

func (r *Rectangle) RotateAboutOrigin(theta float64)

func (*Rectangle) RotateAboutVector2

func (r *Rectangle) RotateAboutVector2(theta float64, v *Vector2)

func (*Rectangle) RotateAboutXY

func (r *Rectangle) RotateAboutXY(theta, x, y float64)

func (*Rectangle) SetUserData

func (r *Rectangle) SetUserData(data interface{})

func (*Rectangle) TranslateVector2

func (r *Rectangle) TranslateVector2(v *Vector2)

func (*Rectangle) TranslateXY

func (r *Rectangle) TranslateXY(x, y float64)

type Segment

type Segment struct {
	Wound
	// contains filtered or unexported fields
}

func CreateHorizontalSegment

func CreateHorizontalSegment(length float64) *Segment

func CreateSegment

func CreateSegment(p1, p2 *Vector2) *Segment

func CreateSegmentAtOrigin

func CreateSegmentAtOrigin(p1, p2 *Vector2) *Segment

func CreateSegmentEnd

func CreateSegmentEnd(end *Vector2) *Segment

func CreateVerticalSegment

func CreateVerticalSegment(length float64) *Segment

func NewSegment

func NewSegment(p1, p2 *Vector2) *Segment

func ScaleSegment

func ScaleSegment(segment *Segment, scale float64) *Segment

func (*Segment) ContainsTransformRadius

func (s *Segment) ContainsTransformRadius(point *Vector2, transform *Transform, radius float64) bool

func (*Segment) ContainsVector2

func (s *Segment) ContainsVector2(v *Vector2) bool

func (*Segment) ContainsVector2Transform

func (s *Segment) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Segment) CreateAABB

func (s *Segment) CreateAABB() *AABB

func (*Segment) CreateAABBTransform

func (s *Segment) CreateAABBTransform(transform *Transform) *AABB

func (*Segment) CreateMass

func (s *Segment) CreateMass(density float64) *Mass

func (*Segment) GetAxes

func (s *Segment) GetAxes(foci []*Vector2, t *Transform) []*Vector2

func (*Segment) GetFarthestFeature

func (s *Segment) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Segment) GetFarthestPoint

func (s *Segment) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Segment) GetFoci

func (s *Segment) GetFoci(transform *Transform) []*Vector2

func (*Segment) GetLength

func (s *Segment) GetLength() float64

func (*Segment) GetLineIntersection

func (s *Segment) GetLineIntersection(segment *Segment) *Vector2

func (*Segment) GetPoint1

func (s *Segment) GetPoint1() *Vector2

func (*Segment) GetPoint2

func (s *Segment) GetPoint2() *Vector2

func (*Segment) GetPointOnLineClosestToPoint

func (s *Segment) GetPointOnLineClosestToPoint(point *Vector2) *Vector2

func (*Segment) GetPointOnSegmentClosestToPoint

func (s *Segment) GetPointOnSegmentClosestToPoint(point *Vector2) *Vector2

func (*Segment) GetRadiusVector2

func (s *Segment) GetRadiusVector2(v *Vector2) float64

func (*Segment) GetSegmentIntersection

func (s *Segment) GetSegmentIntersection(segment *Segment) *Vector2

func (*Segment) ProjectVector2

func (s *Segment) ProjectVector2(v *Vector2) *Interval

func (*Segment) ProjectVector2Transform

func (s *Segment) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Segment) RotateAboutCenter

func (s *Segment) RotateAboutCenter(theta float64)

func (*Segment) RotateAboutOrigin

func (s *Segment) RotateAboutOrigin(theta float64)

func (*Segment) RotateAboutVector2

func (s *Segment) RotateAboutVector2(theta float64, v *Vector2)

func (*Segment) RotateAboutXY

func (s *Segment) RotateAboutXY(theta, x, y float64)

func (*Segment) TranslateVector2

func (s *Segment) TranslateVector2(v *Vector2)

func (*Segment) TranslateXY

func (s *Segment) TranslateXY(x, y float64)

type Shaper

type Shaper interface {
	Transformer
	GetID() string
	GetCenter() *Vector2
	GetRadius() float64
	GetRadiusVector2(center *Vector2) float64
	GetUserData() interface{}
	SetUserData(data interface{})
	RotateAboutCenter(theta float64)
	ProjectVector2(v *Vector2) *Interval
	ProjectVector2Transform(v *Vector2, t *Transform) *Interval
	ContainsVector2(v *Vector2) bool
	ContainsVector2Transform(v *Vector2, t *Transform) bool
	CreateMass(density float64) *Mass
	CreateAABB() *AABB
	CreateAABBTransform(t *Transform) *AABB
}

type Slice

type Slice struct {
	AbstractShape
	// contains filtered or unexported fields
}

func CreateSlice

func CreateSlice(radius, theta float64) *Slice

func CreateSliceAtOrigin

func CreateSliceAtOrigin(radius, theta float64) *Slice

func NewSlice

func NewSlice(radius, theta float64) *Slice

func ScaleSlice

func ScaleSlice(slice *Slice, scale float64) *Slice

func (*Slice) ContainsVector2

func (s *Slice) ContainsVector2(v *Vector2) bool

func (*Slice) ContainsVector2Transform

func (s *Slice) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Slice) CreateAABB

func (s *Slice) CreateAABB() *AABB

func (*Slice) CreateAABBTransform

func (s *Slice) CreateAABBTransform(transform *Transform) *AABB

func (*Slice) CreateMass

func (s *Slice) CreateMass(density float64) *Mass

func (*Slice) GetAxes

func (s *Slice) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*Slice) GetCircleCenter

func (s *Slice) GetCircleCenter() *Vector2

func (*Slice) GetFarthestFeature

func (s *Slice) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Slice) GetFarthestPoint

func (s *Slice) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Slice) GetFoci

func (s *Slice) GetFoci(transform *Transform) []*Vector2

func (*Slice) GetRadiusVector2

func (s *Slice) GetRadiusVector2(center *Vector2) float64

func (*Slice) GetRotation

func (s *Slice) GetRotation() float64

func (*Slice) GetSliceRadius

func (s *Slice) GetSliceRadius() float64

func (*Slice) GetTheta

func (s *Slice) GetTheta() float64

func (*Slice) ProjectVector2

func (s *Slice) ProjectVector2(v *Vector2) *Interval

func (*Slice) ProjectVector2Transform

func (s *Slice) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Slice) RotateAboutCenter

func (s *Slice) RotateAboutCenter(theta float64)

func (*Slice) RotateAboutOrigin

func (s *Slice) RotateAboutOrigin(theta float64)

func (*Slice) RotateAboutVector2

func (s *Slice) RotateAboutVector2(theta float64, v *Vector2)

func (*Slice) RotateAboutXY

func (s *Slice) RotateAboutXY(theta, x, y float64)

func (*Slice) TranslateVector2

func (s *Slice) TranslateVector2(v *Vector2)

func (*Slice) TranslateXY

func (s *Slice) TranslateXY(x, y float64)

type Transform

type Transform struct {
	X, Y float64
	// contains filtered or unexported fields
}

func NewTransform

func NewTransform() *Transform

func NewTransformFromTransform

func NewTransformFromTransform(t *Transform) *Transform

func (*Transform) GetInverseTransformedR

func (t *Transform) GetInverseTransformedR(v *Vector2) *Vector2

func (*Transform) GetInverseTransformedRInDestination

func (t *Transform) GetInverseTransformedRInDestination(v, v2 *Vector2)

func (*Transform) GetInverseTransformedVector2

func (t *Transform) GetInverseTransformedVector2(v *Vector2) *Vector2

func (*Transform) GetInverseTransformedVector2InDestination

func (t *Transform) GetInverseTransformedVector2InDestination(v, dest *Vector2)

func (*Transform) GetRotation

func (t *Transform) GetRotation() float64

func (*Transform) GetRotationTransform

func (t *Transform) GetRotationTransform() *Transform

func (*Transform) GetTransformedR

func (t *Transform) GetTransformedR(v *Vector2) *Vector2

func (*Transform) GetTransformedRInDestination

func (t *Transform) GetTransformedRInDestination(v, v2 *Vector2)

func (*Transform) GetTransformedVector2

func (t *Transform) GetTransformedVector2(v *Vector2) *Vector2

func (*Transform) GetTransformedVector2InDestination

func (t *Transform) GetTransformedVector2InDestination(v, dest *Vector2)

func (*Transform) GetTranslation

func (t *Transform) GetTranslation() *Vector2

func (*Transform) GetTranslationTransform

func (t *Transform) GetTranslationTransform() *Transform

func (*Transform) GetValues

func (t *Transform) GetValues() []float64

func (*Transform) Identity

func (t *Transform) Identity()

func (*Transform) InverseTransform

func (t *Transform) InverseTransform(v *Vector2)

func (*Transform) InverseTransformR

func (t *Transform) InverseTransformR(v *Vector2)

func (*Transform) Lerp

func (t *Transform) Lerp(end *Transform, alpha float64)

func (*Transform) LerpDelta

func (t *Transform) LerpDelta(dp *Vector2, da, alpha float64)

func (*Transform) LerpDeltaInDestination

func (t *Transform) LerpDeltaInDestination(dp *Vector2, da, alpha float64, result *Transform)

func (*Transform) LerpInDestination

func (t *Transform) LerpInDestination(end *Transform, alpha float64, result *Transform)

func (*Transform) Lerped

func (t *Transform) Lerped(end *Transform, alpha float64) *Transform

func (*Transform) LerpedDelta

func (t *Transform) LerpedDelta(dp *Vector2, da, alpha float64) *Transform

func (*Transform) RotateAboutOrigin

func (t *Transform) RotateAboutOrigin(theta float64)

func (*Transform) RotateAboutVector2

func (t *Transform) RotateAboutVector2(theta float64, v *Vector2)

func (*Transform) RotateAboutXY

func (t *Transform) RotateAboutXY(theta, x, y float64)

func (*Transform) Set

func (t *Transform) Set(t2 *Transform)

func (*Transform) SetRotation

func (t *Transform) SetRotation(theta float64) float64

func (*Transform) SetTranslationFromVector2

func (t *Transform) SetTranslationFromVector2(v *Vector2)

func (*Transform) SetTranslationFromXY

func (t *Transform) SetTranslationFromXY(x, y float64)

func (*Transform) Transform

func (t *Transform) Transform(v *Vector2)

func (*Transform) TransformR

func (t *Transform) TransformR(v *Vector2)

func (*Transform) TranslateVector2

func (t *Transform) TranslateVector2(v *Vector2)

func (*Transform) TranslateXY

func (t *Transform) TranslateXY(x, y float64)

type Transformer

type Transformer interface {
	RotateAboutOrigin(theta float64)
	RotateAboutVector2(theta float64, v *Vector2)
	RotateAboutXY(theta, x, y float64)
	TranslateXY(x, y float64)
	TranslateVector2(v *Vector2)
}

type Triangle

type Triangle Polygon

func CreateEquilateralTriangle

func CreateEquilateralTriangle(height float64) *Triangle

func CreateIsoscelesTriangle

func CreateIsoscelesTriangle(width, height float64) *Triangle

func CreateRightTriangle

func CreateRightTriangle(width, height float64) *Triangle

func CreateRightTriangleMirror

func CreateRightTriangleMirror(width, height float64, mirror bool) *Triangle

func CreateTriangle

func CreateTriangle(p1, p2, p3 *Vector2) *Triangle

func CreateTriangleAtOrigin

func CreateTriangleAtOrigin(p1, p2, p3 *Vector2) *Triangle

func NewTriangle

func NewTriangle(p1, p2, p3 *Vector2) *Triangle

func (*Triangle) ContainsVector2

func (t *Triangle) ContainsVector2(v *Vector2) bool

func (*Triangle) ContainsVector2Transform

func (t *Triangle) ContainsVector2Transform(point *Vector2, transform *Transform) bool

func (*Triangle) CreateAABB

func (t *Triangle) CreateAABB() *AABB

func (*Triangle) CreateAABBTransform

func (t *Triangle) CreateAABBTransform(transform *Transform) *AABB

func (*Triangle) CreateMass

func (t *Triangle) CreateMass(density float64) *Mass

func (*Triangle) GetAxes

func (t *Triangle) GetAxes(foci []*Vector2, transform *Transform) []*Vector2

func (*Triangle) GetFarthestFeature

func (t *Triangle) GetFarthestFeature(n *Vector2, transform *Transform) Featurer

func (*Triangle) GetFarthestPoint

func (t *Triangle) GetFarthestPoint(n *Vector2, transform *Transform) *Vector2

func (*Triangle) GetFoci

func (t *Triangle) GetFoci(transform *Transform) []*Vector2

func (*Triangle) ProjectVector2

func (t *Triangle) ProjectVector2(v *Vector2) *Interval

func (*Triangle) ProjectVector2Transform

func (t *Triangle) ProjectVector2Transform(n *Vector2, transform *Transform) *Interval

func (*Triangle) RotateAboutCenter

func (t *Triangle) RotateAboutCenter(theta float64)

func (*Triangle) RotateAboutOrigin

func (t *Triangle) RotateAboutOrigin(theta float64)

func (*Triangle) RotateAboutVector2

func (t *Triangle) RotateAboutVector2(theta float64, v *Vector2)

func (*Triangle) RotateAboutXY

func (t *Triangle) RotateAboutXY(theta, x, y float64)

func (*Triangle) TranslateVector2

func (t *Triangle) TranslateVector2(v *Vector2)

func (*Triangle) TranslateXY

func (t *Triangle) TranslateXY(x, y float64)

type Vector2

type Vector2 struct {
	X, Y float64
}

func Cleanse

func Cleanse(points []*Vector2) []*Vector2

func GetAreaWeightedCenter

func GetAreaWeightedCenter(points ...*Vector2) *Vector2

func GetAreaWeightedCenterFromList

func GetAreaWeightedCenterFromList(points []*Vector2) *Vector2

func GetAverageCenter

func GetAverageCenter(points ...*Vector2) *Vector2

func GetAverageCenterFromList

func GetAverageCenterFromList(points []*Vector2) *Vector2

func GetFarthestPoint

func GetFarthestPoint(v1, v2, n *Vector2, t *Transform) *Vector2

func GetLineIntersection

func GetLineIntersection(ap1, ap2, bp1, bp2 *Vector2) *Vector2

func GetPointOnLineClosestToPoint

func GetPointOnLineClosestToPoint(point, linePoint1, linePoint2 *Vector2) *Vector2

func GetPointOnSegmentClosestToPoint

func GetPointOnSegmentClosestToPoint(point, linePoint1, linePoint2 *Vector2) *Vector2

func GetSegmentIntersection

func GetSegmentIntersection(ap1, ap2, bp1, bp2 *Vector2) *Vector2

func NewVector2FromA2B

func NewVector2FromA2B(a, b *Vector2) *Vector2

func NewVector2FromA2B_XY

func NewVector2FromA2B_XY(xa, ya, xb, yb float64) *Vector2

func NewVector2FromDirection

func NewVector2FromDirection(direction float64) *Vector2

func NewVector2FromMagnitudeAndDirection

func NewVector2FromMagnitudeAndDirection(magnitude, direction float64) *Vector2

func NewVector2FromVector2

func NewVector2FromVector2(vOrig *Vector2) *Vector2

func NewVector2FromXY

func NewVector2FromXY(x, y float64) *Vector2

func Vector2TripleProduct

func Vector2TripleProduct(a, b, c *Vector2) *Vector2

func (*Vector2) AddVector2

func (v *Vector2) AddVector2(v2 *Vector2) *Vector2

func (*Vector2) AddXY

func (v *Vector2) AddXY(x, y float64) *Vector2

func (*Vector2) CrossVector2

func (v *Vector2) CrossVector2(v2 *Vector2) float64

func (*Vector2) CrossXY

func (v *Vector2) CrossXY(x, y float64) float64

func (*Vector2) CrossZ

func (v *Vector2) CrossZ(z float64) *Vector2

func (*Vector2) DifferenceVector2

func (v *Vector2) DifferenceVector2(v2 *Vector2) *Vector2

func (*Vector2) DifferenceXY

func (v *Vector2) DifferenceXY(x, y float64) *Vector2

func (*Vector2) DistanceFromVector2

func (v *Vector2) DistanceFromVector2(v2 *Vector2) float64

func (*Vector2) DistanceFromXY

func (v *Vector2) DistanceFromXY(x, y float64) float64

func (*Vector2) DistanceSquaredFromVector2

func (v *Vector2) DistanceSquaredFromVector2(v2 *Vector2) float64

func (*Vector2) DistanceSquaredFromXY

func (v *Vector2) DistanceSquaredFromXY(x, y float64) float64

func (*Vector2) DotVector2

func (v *Vector2) DotVector2(v2 *Vector2) float64

func (*Vector2) DotXY

func (v *Vector2) DotXY(x, y float64) float64

func (*Vector2) EqualsVector2

func (v *Vector2) EqualsVector2(v2 *Vector2) bool

func (*Vector2) EqualsXY

func (v *Vector2) EqualsXY(x, y float64) bool

func (*Vector2) GetAngleBetween

func (v *Vector2) GetAngleBetween(v2 *Vector2) float64

func (*Vector2) GetDirection

func (v *Vector2) GetDirection() float64

func (*Vector2) GetLeftHandOrthogonalVector

func (v *Vector2) GetLeftHandOrthogonalVector() *Vector2

func (*Vector2) GetMagnitude

func (v *Vector2) GetMagnitude() float64

func (*Vector2) GetMagnitudeSquared

func (v *Vector2) GetMagnitudeSquared() float64

func (*Vector2) GetNegative

func (v *Vector2) GetNegative() *Vector2

func (*Vector2) GetNormalized

func (v *Vector2) GetNormalized() *Vector2

func (*Vector2) GetRightHandOrthogonalVector

func (v *Vector2) GetRightHandOrthogonalVector() *Vector2

func (*Vector2) GetXComponent

func (v *Vector2) GetXComponent() *Vector2

func (*Vector2) GetYComponent

func (v *Vector2) GetYComponent() *Vector2

func (*Vector2) HereToVector2

func (v *Vector2) HereToVector2(v2 *Vector2) *Vector2

func (*Vector2) HereToXY

func (v *Vector2) HereToXY(x, y float64) *Vector2

func (*Vector2) IsOrthogonalVector2

func (v *Vector2) IsOrthogonalVector2(v2 *Vector2) bool

func (*Vector2) IsOrthogonalXY

func (v *Vector2) IsOrthogonalXY(x, y float64) bool

func (*Vector2) IsZero

func (v *Vector2) IsZero() bool

func (*Vector2) Left

func (v *Vector2) Left() *Vector2

func (*Vector2) Multiply

func (v *Vector2) Multiply(scalar float64) *Vector2

func (*Vector2) Negate

func (v *Vector2) Negate() *Vector2

func (*Vector2) Normalize

func (v *Vector2) Normalize() float64

func (*Vector2) Product

func (v *Vector2) Product(scalar float64) *Vector2

func (*Vector2) Project

func (v *Vector2) Project(v2 *Vector2) *Vector2

func (*Vector2) Right

func (v *Vector2) Right() *Vector2

func (*Vector2) RotateAboutOrigin

func (v *Vector2) RotateAboutOrigin(theta float64) *Vector2

func (*Vector2) RotateAboutVector2

func (v *Vector2) RotateAboutVector2(theta float64, v2 *Vector2) *Vector2

func (*Vector2) RotateAboutXY

func (v *Vector2) RotateAboutXY(theta, x, y float64) *Vector2

func (*Vector2) SetDirection

func (v *Vector2) SetDirection(angle float64) *Vector2

func (*Vector2) SetMagnitude

func (v *Vector2) SetMagnitude(magnitude float64) *Vector2

func (*Vector2) SetToVector2

func (v *Vector2) SetToVector2(v2 *Vector2) *Vector2

func (*Vector2) SetToXY

func (v *Vector2) SetToXY(x, y float64) *Vector2

func (*Vector2) String

func (v *Vector2) String() string

func (*Vector2) SubtractVector2

func (v *Vector2) SubtractVector2(v2 *Vector2) *Vector2

func (*Vector2) SubtractXY

func (v *Vector2) SubtractXY(x, y float64) *Vector2

func (*Vector2) SumVector2

func (v *Vector2) SumVector2(v2 *Vector2) *Vector2

func (*Vector2) SumXY

func (v *Vector2) SumXY(x, y float64) *Vector2

func (*Vector2) Zero

func (v *Vector2) Zero() *Vector2

type Vector3

type Vector3 struct {
	X, Y, Z float64
}

func NewVector3FromFloats

func NewVector3FromFloats(x, y, z float64) *Vector3

func NewVector3FromFloatsDifference

func NewVector3FromFloatsDifference(x1, y1, z1, x2, y2, z2 float64) *Vector3

func NewVector3FromVector3

func NewVector3FromVector3(v *Vector3) *Vector3

func NewVector3FromVector3Difference

func NewVector3FromVector3Difference(p1, p2 *Vector3) *Vector3

func Vector3TripleProduct

func Vector3TripleProduct(a, b, c *Vector3) *Vector3

func (*Vector3) AddFloats

func (v *Vector3) AddFloats(x, y, z float64) *Vector3

func (*Vector3) AddVector3

func (v *Vector3) AddVector3(v2 *Vector3) *Vector3

func (*Vector3) CrossFloats

func (v *Vector3) CrossFloats(x, y, z float64) *Vector3

func (*Vector3) CrossVector3

func (v *Vector3) CrossVector3(v2 *Vector3) *Vector3

func (*Vector3) DifferenceFloats

func (v *Vector3) DifferenceFloats(x, y, z float64) *Vector3

func (*Vector3) DifferenceVector3

func (v *Vector3) DifferenceVector3(v2 *Vector3) *Vector3

func (*Vector3) DistanceFloats

func (v *Vector3) DistanceFloats(x, y, z float64) float64

func (*Vector3) DistanceSquaredFloats

func (v *Vector3) DistanceSquaredFloats(x, y, z float64) float64

func (*Vector3) DistanceSquaredVector3

func (v *Vector3) DistanceSquaredVector3(v2 *Vector3) float64

func (*Vector3) DistanceVector3

func (v *Vector3) DistanceVector3(v2 *Vector3) float64

func (*Vector3) DotFloats

func (v *Vector3) DotFloats(x, y, z float64) float64

func (*Vector3) DotVector3

func (v *Vector3) DotVector3(v2 *Vector3) float64

func (*Vector3) GetMagnitude

func (v *Vector3) GetMagnitude() float64

func (*Vector3) GetMagnitudeSquared

func (v *Vector3) GetMagnitudeSquared() float64

func (*Vector3) GetNegative

func (v *Vector3) GetNegative() *Vector3

func (*Vector3) GetNormalised

func (v *Vector3) GetNormalised() *Vector3

func (*Vector3) GetXComponent

func (v *Vector3) GetXComponent() *Vector3

func (*Vector3) GetYComponent

func (v *Vector3) GetYComponent() *Vector3

func (*Vector3) GetZComponent

func (v *Vector3) GetZComponent() *Vector3

func (*Vector3) HereToFloats

func (v *Vector3) HereToFloats(x, y, z float64) *Vector3

func (*Vector3) HereToVector3

func (v *Vector3) HereToVector3(v2 *Vector3) *Vector3

func (*Vector3) IsOrthogonalFloats

func (v *Vector3) IsOrthogonalFloats(x, y, z float64) bool

func (*Vector3) IsOrthogonalVector3

func (v *Vector3) IsOrthogonalVector3(v2 *Vector3) bool

func (*Vector3) IsZero

func (v *Vector3) IsZero() bool

func (*Vector3) Multiply

func (v *Vector3) Multiply(s float64) *Vector3

func (*Vector3) Negate

func (v *Vector3) Negate() *Vector3

func (*Vector3) Normalise

func (v *Vector3) Normalise() float64

func (*Vector3) Product

func (v *Vector3) Product(s float64) *Vector3

func (*Vector3) Project

func (v *Vector3) Project(v2 *Vector3) *Vector3

func (*Vector3) SetFloats

func (v *Vector3) SetFloats(x, y, z float64) *Vector3

func (*Vector3) SetMagnitude

func (v *Vector3) SetMagnitude(magnitude float64) *Vector3

func (*Vector3) SetVector3

func (v *Vector3) SetVector3(v2 *Vector3) *Vector3

func (*Vector3) SubtractFloats

func (v *Vector3) SubtractFloats(x, y, z float64) *Vector3

func (*Vector3) SubtractVector3

func (v *Vector3) SubtractVector3(v2 *Vector3) *Vector3

func (*Vector3) SumFloats

func (v *Vector3) SumFloats(x, y, z float64) *Vector3

func (*Vector3) SumVector3

func (v *Vector3) SumVector3(v2 *Vector3) *Vector3

func (*Vector3) Zero

func (v *Vector3) Zero() *Vector3

type Vertex

type Vertex struct {
	Feature
	// contains filtered or unexported fields
}

func NewVertexVector2

func NewVertexVector2(v *Vector2) *Vertex

func NewVertexVector2Int

func NewVertexVector2Int(v *Vector2, i int) *Vertex

func (*Vertex) GetIndex

func (v *Vertex) GetIndex() int

func (*Vertex) GetPoint

func (v *Vertex) GetPoint() *Vector2

type Wound

type Wound struct {
	AbstractShape
	// contains filtered or unexported fields
}

func (*Wound) GetNormals

func (w *Wound) GetNormals() []*Vector2

func (*Wound) GetRadiusVector2

func (w *Wound) GetRadiusVector2(center *Vector2) float64

func (*Wound) GetVertices

func (w *Wound) GetVertices() []*Vector2

type Wounder

type Wounder interface {
	Shaper
	GetVertices() []*Vector2
	GetNormals() []*Vector2
}

type WounderConvexer

type WounderConvexer interface {
	GetVertices() []*Vector2
	GetNormals() []*Vector2
	Convexer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL