bezier2

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

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 2 Imported by: 0

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).

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL