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

Method extend

plotter/contour.go:436–464  ·  view source on GitHub ↗

extend adds the line l to the contour, updating the ends map. It returns a boolean indicating whether the extension was successful.

(l line, ends endMap)

Source from the content-addressed store, hash-verified

434// extend adds the line l to the contour, updating the ends map. It returns
435// a boolean indicating whether the extension was successful.
436func (c *contour) extend(l line, ends endMap) (ok bool) {
437 switch c.front() {
438 case l.p1:
439 c.backward = append(c.backward, l.p2)
440 delete(ends, l.p1)
441 ends[l.p2] = c
442 return true
443 case l.p2:
444 c.backward = append(c.backward, l.p1)
445 delete(ends, l.p2)
446 ends[l.p1] = c
447 return true
448 }
449
450 switch c.back() {
451 case l.p1:
452 c.forward = append(c.forward, l.p2)
453 delete(ends, l.p1)
454 ends[l.p2] = c
455 return true
456 case l.p2:
457 c.forward = append(c.forward, l.p1)
458 delete(ends, l.p2)
459 ends[l.p1] = c
460 return true
461 }
462
463 return false
464}
465
466// reverse reverses the order of the point in a path and returns it.
467func (p path) reverse() path {

Callers 1

pathsFunction · 0.80

Calls 2

frontMethod · 0.95
backMethod · 0.95

Tested by

no test coverage detected