# bezier2

package
Version: v0.0.0-...-20a26e3 Latest Latest

Go to latest
Published: Jul 28, 2021 License: MIT

## Documentation ¶

### Overview ¶

Package bezier2 contains functions for 2D cubic Bezier splines. See: http://en.wikipedia.org/wiki/B%C3%A9zier_curve

### Constants ¶

This section is empty.

### Variables ¶

This section is empty.

### Functions ¶

#### func Length ¶

`func Length(p0, p1, p2, p3 *vec2.T, t float64) float64`

Length returns the length of a cubic bezier spline from p0 to t (0,1).

#### func Point ¶

`func Point(p0, p1, p2, p3 *vec2.T, t float64) vec2.T`

Point returns a point on a cubic bezier spline at t (0,1).

#### func Tangent ¶

`func Tangent(p0, p1, p2, p3 *vec2.T, t float64) vec2.T`

Tangent returns a tangent on a cubic bezier spline at t (0,1).

### Types ¶

#### type T ¶

```type T struct {
P0, P1, P2, P3 vec2.T
}```

T holds the data to define a cubic bezier spline.

#### func Parse ¶

`func Parse(s string) (r T, err error)`

#### func (*T) Length ¶

`func (bez *T) Length(t float64) float64`

Length returns the length of a cubic bezier spline from A.Point to t (0,1).

#### func (*T) Point ¶

`func (bez *T) Point(t float64) vec2.T`

Point returns a point on a cubic bezier spline at t (0,1).

#### func (*T) String ¶

`func (bez *T) String() string`

#### func (*T) Tangent ¶

`func (bez *T) Tangent(t float64) vec2.T`

Tangent returns a tangent on a cubic bezier spline at t (0,1).