hermit2

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package hermit2 contains functions for 2D cubic hermit splines. See: http://en.wikipedia.org/wiki/Cubic_Hermite_spline

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Length

func Length(pointA, tangentA, pointB, tangentB *vec2.T, t float64) float64

Length returns the length of a hermit spline from pointA to t (0,1).

func Point

func Point(pointA, tangentA, pointB, tangentB *vec2.T, t float64) vec2.T

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

func Tangent

func Tangent(pointA, tangentA, pointB, tangentB *vec2.T, t float64) vec2.T

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

Types

type PointTangent

type PointTangent struct {
	Point   vec2.T
	Tangent vec2.T
}

PointTangent contains a point and a tangent at that point. This is a helper sub-struct for T.

type T

type T struct {
	A PointTangent
	B PointTangent
}

T holds the data to define a hermit spline.

func Parse

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

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

func (*T) Length

func (herm *T) Length(t float64) float64

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

func (*T) Point

func (herm *T) Point(t float64) vec2.T

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

func (*T) String

func (herm *T) String() string

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

func (*T) Tangent

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

Tangent returns a tangent on a hermit 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