You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CoordinatePair is a struct type with two properties, X and Y coordinates
typeCoordinatePairstruct {
Xfloat64
Yfloat64
}
// SortCoordinatePairs is a function which receives a slice of CoordinatePairs, and sorts it in ascending order.
funcSortCoordinatePairs(cp []CoordinatePair) {
sort.Slice(cp, func(i, jint) bool {
returncp[i].X<cp[j].X
})
}
// SlicesToCoordinatePairs is a function which receives two slices of floats (x and y), turns them into a slice of CoordinatePairs, and returns the result.
funcSlicesToCoordinatePairs(x, y []float64) []CoordinatePair {