Documentation ¶
Index ¶
- Variables
- type Intersector
- type Line
- func (l Line) AssertEqual(actual interface{}, t cmpr.Tolerance) error
- func (l Line) AtX(x float64) float64
- func (l Line) AtY(y float64) float64
- func (l Line) B() float64
- func (l Line) Centroid() d2.Pt
- func (l Line) Closest(pt d2.Pt) d2.Pt
- func (l Line) ClosestT(pt d2.Pt) float64
- func (l Line) Cross(pt d2.Pt) float64
- func (l Line) Intersection(l2 Line) (float64, float64, bool)
- func (Line) L(t, c int) d2.Limit
- func (l Line) LineIntersections(l2 Line, buf []float64) []float64
- func (l Line) M() float64
- func (l Line) PartialIntersection(l2 Line) (t, cross float64, v d2.V)
- func (l Line) Pt1(t float64) d2.Pt
- func (l Line) String() string
- func (l Line) T(t *d2.T) Line
- func (l Line) V1(t float64) d2.V
- func (Line) VL(t, c int) d2.Limit
- type Range
- type Segments
Constants ¶
This section is empty.
Variables ¶
var DefaultRange = Range{ T0: &[2]float64{0, 1}, T1: &[2]float64{0, 1}, }
DefaultRange checks that
var Small = cmpr.Tolerance(1e-12)
Small is the value that will be used to compare against 0.
Functions ¶
This section is empty.
Types ¶
type Intersector ¶
Intersector finds the points where the interface intersects a line. The returned values should be relative to the line passed in. The buffer both provides reuse to avoid generating garbage and allows for fine tuning. If the buffer has a length of 0, all the intersections will be appended. If the buffer has a non-zero length, that output will be limited. So if a buffer of length 1 is passed in, only the first intersection is returned. But there is no guarenteed order.
type Line ¶
Line in 2D space invoked parametrically
func Bisect ¶
Bisect returns a line that bisects points a and b. All points on the line are equadistant from both a and b. At t=0, the mid-point is returned. At t=1, the point is the same distance from t=0 as the two definition points.
func TangentLine ¶
TangentLine takes a Pt1V1 and a parametric t0 and returns a line on the curve at that point, tangent to that point.
func (Line) AssertEqual ¶
AssertEqual fulfils geomtest.AssertEqualizer
func (Line) Intersection ¶
Intersection returns the parametric values of the intersection point on the line passed in as an argument and a bool indicating if there was an intersection.
func (Line) LineIntersections ¶
LineIntersections returns the points at which the lines intersect. It fulls the Intersections interface. If the lines are parallel, nil is returned. Otherwise a slice with a single value is returned indicating the parametric point along l2 at which the intersection occures.
func (Line) PartialIntersection ¶
PartialIntersection finds the intersection of l and l2 relative to l2. It also returns the cross product and v which is the vector from l.T0 to l2.T0.
type Segments ¶
Segments links together a series of points and fulfils Curve.
func (Segments) LineIntersections ¶
LineIntersections fulfills Intersections, returning the points that intersect the line.