collide

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package collide provides 2D swept / proximity hit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClosestHitAlongSegment

func ClosestHitAlongSegment(ax, ay, bx, by, hitRadius float64, each func(yield func(x, y float64, id uint64))) (id uint64, ok bool)

ClosestHitAlongSegment finds the candidate whose center is closest to segment AB among those within hitRadius. each should call yield(x, y, id) for every candidate. Returns the winning id.

func DistPointSegment

func DistPointSegment(px, py, ax, ay, bx, by float64) float64

DistPointSegment returns distance from P to the closest point on segment AB.

func SegmentHitsCircle

func SegmentHitsCircle(ax, ay, bx, by, cx, cy, radius float64) bool

SegmentHitsCircle reports whether segment AB comes within radius of (cx,cy).

Types

This section is empty.

Jump to

Keyboard shortcuts

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