geometry2d

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClosestPointToSegment

func GetClosestPointToSegment(point vector2.Vector2, segment [2]vector2.Vector2) vector2.Vector2

func GetClosestPointToSegmentUncapped

func GetClosestPointToSegmentUncapped(point vector2.Vector2, segment [2]vector2.Vector2) vector2.Vector2

func GetClosestPointsBetweenSegments

func GetClosestPointsBetweenSegments(p1, q1, p2, q2 vector2.Vector2) float64

func GetDistanceSquaredToSegment

func GetDistanceSquaredToSegment(point vector2.Vector2, segment [2]vector2.Vector2) float64

func GetDistanceToSegment

func GetDistanceToSegment(point vector2.Vector2, segment [2]vector2.Vector2) float64

func IsPolygonClockwise

func IsPolygonClockwise(polygon []vector2.Vector2) bool

IsPolygonClockwise determines if the given polygon points are in a clockwise order.

func LineIntersectsLine

func LineIntersectsLine(from_a, dir_a, from_b, dir_b vector2.Vector2) vector2.Vector2

func OffsetPolygon

func OffsetPolygon(polygon []vector2.Vector2, delta float64, joinType JoinType) [][]vector2.Vector2

func OffsetPolyline

func OffsetPolyline(polygon []vector2.Vector2, delta float64, joinType JoinType, endType EndType) [][]vector2.Vector2

func SegmentIntersectsSegment

func SegmentIntersectsSegment(from_a, to_a, from_b, to_b vector2.Vector2) vector2.Vector2

Types

type EndType

type EndType int

PolyEndType defines the end type for open paths.

const (
	EndTypePolygon EndType = iota
	EndTypeJoined
	EndTypeButt
	EndTypeSquare
	EndTypeRound
)

type JoinType

type JoinType int

PolyJoinType defines the type of join for polygon edges.

const (
	JoinTypeSquare JoinType = iota
	JoinTypeRound
	JoinTypeMiter
)

Jump to

Keyboard shortcuts

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