convexhull

package
Version: v0.0.0-...-7dae096 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Stack implementation from https://gist.github.com/bemasher/1777766

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Area2

func Area2(a, b, c Point) float64

func PrintStack

func PrintStack(s *Stack)

Types

type Element

type Element struct {
	// contains filtered or unexported fields
}

type Point

type Point struct {
	X, Y float64
}

func MakePoint

func MakePoint(x float64, y float64) Point

type PointList

type PointList []Point

func (PointList) Compute

func (points PointList) Compute() (PointList, bool)

func (PointList) DrawLines

func (points PointList) DrawLines()

func (PointList) DrawLowestPoint

func (points PointList) DrawLowestPoint()

func (PointList) DrawPoints

func (points PointList) DrawPoints()

func (PointList) FindLowestPoint

func (p PointList) FindLowestPoint()

func (PointList) Len

func (p PointList) Len() int

Implement sort interface

func (PointList) Less

func (p PointList) Less(i, j int) bool

func (PointList) Swap

func (p PointList) Swap(i, j int)

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func (*Stack) Len

func (s *Stack) Len() int

Return the stack's length

func (*Stack) Pop

func (s *Stack) Pop() (value interface{})

Remove the top element from the stack and return it's value If the stack is empty, return nil

func (*Stack) Push

func (s *Stack) Push(value interface{})

Push a new element onto the stack

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