bezier2

package
v0.0.0-...-55ced4b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

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

Index

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)

Parse parses T from a string. See also String()

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

String formats T as string. See also Parse().

func (*T) Tangent

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

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

Jump to

Keyboard shortcuts

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