For example this 2x2 grid.
func main() {
width := 2
height := 2
grid := make([]float64, width*height)
for i := 0; i < width*height; i++ {
grid[i] = float64(i)
}
m := contourmap.FromFloat64s(width, height, grid)
contours := m.Contours(1.5)
for _, contour := range contours {
fmt.Print("[")
for i, point := range contour {
if i > 0 {
fmt.Print(", ")
}
fmt.Print(point.X, point.Y)
}
fmt.Println("]")
}
}