lineintersection

package
v0.0.0-...-1491eae Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: BSD-2-Clause Imports: 1 Imported by: 0

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 LineIntersectsLine函数的返回结果 . 它包含交叉点(S),并指示有交集的类型(或没有交集)。

func NewResult

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

NewResult函数 创建一个结果对象

func (*Result) HasIntersection

func (i *Result) HasIntersection() bool

* *------------------------------ * Result(结果集)相关的方法 *---------------------------------

HasIntersection方法 如果交叉返回true

func (*Result) Intersection

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

Intersection 返回一个交点数组 如果 type 是 PointIntersection ,返回一个点(第一个点) 如果 type 是 CollinearIntersection ,返回两个点,一个是线的起点,一个是线的终点

func (*Result) Type

func (i *Result) Type() Type

Type方法 返回两条线的交叉类型

type Type

type Type int

Type 枚举了两条线的位置关系

const (
	// NoIntersection 表示不相交
	NoIntersection Type = iota
	// PointIntersection 表示相交于某一点
	PointIntersection
	// CollinearIntersection 表示两条线相互重叠
	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