curves

package
v0.0.0-...-50c553c Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinomialCoefficient

func BinomialCoefficient(n, k int64) int64

Types

type Bezier

type Bezier struct {
	ApproxLength float64
	// contains filtered or unexported fields
}

func NewBezier

func NewBezier(points []math2.Vector2d) Bezier

func (Bezier) GetEndAngle

func (bz Bezier) GetEndAngle() float64

func (Bezier) GetLength

func (bz Bezier) GetLength() float64

func (Bezier) GetPoints

func (ln Bezier) GetPoints(num int) []math2.Vector2d

func (Bezier) GetStartAngle

func (bz Bezier) GetStartAngle() float64

func (Bezier) NPointAt

func (bz Bezier) NPointAt(t float64) math2.Vector2d

func (Bezier) PointAt

func (bz Bezier) PointAt(t float64) math2.Vector2d

It's not a neat solution, but it works This calculates point on bezier with constant velocity

type Catmull

type Catmull struct {
	ApproxLength float64
	// contains filtered or unexported fields
}

func NewCatmull

func NewCatmull(points []math2.Vector2d) Catmull

func (Catmull) GetEndAngle

func (cm Catmull) GetEndAngle() float64

func (Catmull) GetLength

func (cm Catmull) GetLength() float64

func (Catmull) GetPoints

func (ln Catmull) GetPoints(num int) []math2.Vector2d

func (Catmull) GetStartAngle

func (cm Catmull) GetStartAngle() float64

func (Catmull) NPointAt

func (cm Catmull) NPointAt(t float64) math2.Vector2d

func (Catmull) PointAt

func (cm Catmull) PointAt(t float64) math2.Vector2d

It's not a neat solution, but it works This calculates point on catmull curve with constant velocity

type CirArc

type CirArc struct {
	Unstable bool
	// contains filtered or unexported fields
}

func NewCirArc

func NewCirArc(pt1, pt2, pt3 math2.Vector2d) CirArc

func (CirArc) GetEndAngle

func (ln CirArc) GetEndAngle() float64

func (CirArc) GetLength

func (ln CirArc) GetLength() float64

func (CirArc) GetPoints

func (ln CirArc) GetPoints(num int) []math2.Vector2d

func (CirArc) GetStartAngle

func (ln CirArc) GetStartAngle() float64

func (CirArc) PointAt

func (ln CirArc) PointAt(t float64) math2.Vector2d

type Curve

type Curve interface {
	PointAt(t float64) bmath.Vector2d
	GetStartAngle() float64
	GetEndAngle() float64
	GetLength() float64
}

type Linear

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

func NewLinear

func NewLinear(pt1, pt2 math2.Vector2d) Linear

func (Linear) GetEndAngle

func (ln Linear) GetEndAngle() float64

func (Linear) GetLength

func (ln Linear) GetLength() float64

func (Linear) GetStartAngle

func (ln Linear) GetStartAngle() float64

func (Linear) PointAt

func (ln Linear) PointAt(t float64) math2.Vector2d

Jump to

Keyboard shortcuts

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