bezier

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: BSD-3-Clause Imports: 1 Imported by: 12

Documentation

Overview

Package bezier implements 2D Bézier curve calculation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Curve

type Curve []point

Curve implements Bezier curve calculation according to the algorithm of Robert D. Miller.

Graphics Gems 5, 'Quick and Simple Bézier Curve Drawing', pages 206-209.

func New

func New(cp ...vg.Point) Curve

NewCurve returns a Curve initialized with the control points in cp.

func (Curve) Curve

func (c Curve) Curve(p []vg.Point) []vg.Point

Curve returns a slice of vg.Point, p, filled with points along the Bézier curve described by c. If the length of p is less than 2, the curve points are undefined. The length of p is not altered by the call.

func (Curve) Point

func (c Curve) Point(t float64) vg.Point

Point returns the point at t along the curve, where 0 ≤ t ≤ 1.

Jump to

Keyboard shortcuts

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