upath

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package upath implements operations on slices of image.Points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(start, end image.Point) float64

Distance returns the distance between two points.

func DistanceToLine

func DistanceToLine(point, line1, line2 image.Point) float64

DistanceToLine calculates the distance from a point to a line which passes through points line1 and line2.

func Lerp

func Lerp(fac float64, start, end []image.Point) []image.Point

Lerp linearally interpolates between two paths. If the paths differ in length, the returned path will only be as long as the smaller one. This function will always return a new slice.

func MultiLerp

func MultiLerp(fac float64, stages ...[]image.Point) []image.Point

MultiLerp is like Lerp, but interpolates through several "stages". This function will always return a new slice. If no stages are provided, it will return nil.

func P

func P(data ...int) []image.Point

P creates a path fom a list of integers that form X-Y pairs.

func Translate

func Translate(delta image.Point, path []image.Point)

Translate adds delta to all points in path. This modifies the slice contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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