MCPcopy Index your code
hub / github.com/gonum/plot / path

Method path

plotter/contour.go:413–426  ·  view source on GitHub ↗
(trX, trY func(float64) vg.Length)

Source from the content-addressed store, hash-verified

411}
412
413func (c *contour) path(trX, trY func(float64) vg.Length) vg.Path {
414 var pa vg.Path
415 p := c.front()
416 pa.Move(vg.Point{X: trX(p.X), Y: trY(p.Y)})
417 for i := len(c.backward) - 2; i >= 0; i-- {
418 p = c.backward[i]
419 pa.Line(vg.Point{X: trX(p.X), Y: trY(p.Y)})
420 }
421 for _, p := range c.forward {
422 pa.Line(vg.Point{X: trX(p.X), Y: trY(p.Y)})
423 }
424
425 return pa
426}
427
428// front returns the first point in the contour.
429func (c *contour) front() point { return c.backward[len(c.backward)-1] }

Callers 1

contourPathsFunction · 0.80

Calls 3

frontMethod · 0.95
MoveMethod · 0.95
LineMethod · 0.95

Tested by

no test coverage detected