bresenham

package module
v0.0.0-...-3ab2d5f Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: ISC Imports: 1 Imported by: 0

README

Bresenham

A quick generic implementation of Bresenham's Line Algorithm.

Usage

Arguments are constrained to signed types. The line is returned as a slice of type Point[T], a type provided by the library.

Documentation

Overview

Package bresenham provides a generic implementation of Bresenham's Line Algorithm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point[T constraints.Signed] struct {
	X T
	Y T
}

Point is a generic struct holding two generic coordinates with a constraint of Signed

func Bresenham

func Bresenham[T constraints.Signed](x0, y0, x1, y1 T) []Point[T]

Bresenham requires arguments of any signed type. The line is generated and returned as a slice of Point[T]

Jump to

Keyboard shortcuts

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