Documentation ¶
Index ¶
- type Bezier
- type Coefficients
- type Derivative
- type Poly
- func (p Poly) Add(p2 Poly) Poly
- func (p Poly) Copy(buf []d2.V) Poly
- func (p Poly) LineIntersections(l line.Line, buf []float64) []float64
- func (p Poly) Multiply(p2 Poly) Poly
- func (p Poly) PolyLineIntersections(l line.Line, buf []float64) []float64
- func (p Poly) Pt1(t0 float64) d2.Pt
- func (p Poly) V() V
- func (p Poly) V1(t0 float64) d2.V
- func (p Poly) V1c0() d2.V1
- func (p Poly) X() poly1d.Poly
- func (p Poly) Y() poly1d.Poly
- type Product
- type Slice
- type Sum
- type V
- type X
- type Y
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bezier ¶
Bezier fulfills Coefficients representing a Bezier as a polynomial.
func (Bezier) Coefficient ¶
Coefficient at the given index of the polynomial representation of the Bezier curve.
type Coefficients ¶
Coefficients wraps the concept of a list of d2.V. It must return the length and be able to return the coefficient at any index.
type Derivative ¶
type Derivative struct {
Coefficients
}
Derivative of the underlying Coefficients.
func (Derivative) Coefficient ¶
func (d Derivative) Coefficient(idx int) d2.V
Coefficient at idx is (idx+1)*Coefficient(idx+1).
func (Derivative) Len ¶
func (d Derivative) Len() int
Len is one less than the underlying Coefficients.
type Poly ¶
type Poly struct {
Coefficients
}
Poly is a 2D polynomial curve.
func (Poly) Copy ¶
Copy the coefficients into an instance of Slice. The provided buffer will be used if it has sufficient capacity.
func (Poly) LineIntersections ¶
LineIntersections fulfills line.Intersector and returns the intersections relative to the line.
func (Poly) PolyLineIntersections ¶
PolyLineIntersections returns the intersection points relative to the Polynomial curve.
type Product ¶
type Product [2]Coefficients
Produce of two Coefficients.
func (Product) Coefficient ¶
Coefficient of the product at the given index.
type Slice ¶
Slice fulfills Coefficients using a Slice.
func (Slice) Coefficient ¶
Coefficient returns the d2.V at the given index if it is in range, otherwise it returns d2.V{0,0}.
type Sum ¶
type Sum [2]Coefficients
Sum fulfills Coefficients by adding the two underlying Coefficients together.
func (Sum) Coefficient ¶
Coefficient returns the sum of both Coefficients at the given index.
type V ¶
type V struct {
Poly
}
V represents the derivative of a Polynomial and will return d2.V instead of d2.Pt.
type X ¶
type X struct{ Coefficients }
X converts and instance of Coefficients into a set of 1D Coefficients using their X components.
func (X) Coefficient ¶
Coefficient returns the X value of the underlying Coefficients.
type Y ¶
type Y struct{ Coefficients }
Y converts and instance of Coefficients into a set of 1D Coefficients using their Y components.
func (Y) Coefficient ¶
Coefficient returns the Y value of the underlying Coefficients.