lineintersection

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: BSD-2-Clause Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

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

Result the results from LineIntersectsLine function. It contains the intersection point(s) and indicates what type of intersection there was (or if there was no intersection)

func NewResult

func NewResult(intersectionType Type, intersection []geom.Coord) Result

NewResult create a new result object

func (*Result) HasIntersection

func (i *Result) HasIntersection() bool

HasIntersection returns true if the lines have an intersection

func (*Result) Intersection

func (i *Result) Intersection() []geom.Coord

Intersection returns an array of Coords which are the intersection points. If the type is PointIntersection then there will only be a single Coordinate (the first coord). If the type is CollinearIntersection then there will two Coordinates the start and end points of the line that represents the intersection

func (*Result) Type

func (i *Result) Type() Type

Type returns the type of intersection between the two lines

type Type

type Type int

Type enumerates the types of intersection two lines can have

const (
	// NoIntersection indicates that the lines do not intersect
	NoIntersection Type = iota
	// PointIntersection indicates that the lines intersect at a point
	PointIntersection
	// CollinearIntersection indicates that the lines overlap each other
	CollinearIntersection
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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