{"id":13411617,"url":"https://github.com/google/hilbert","last_synced_at":"2025-03-14T17:30:59.536Z","repository":{"id":36018654,"uuid":"40313556","full_name":"google/hilbert","owner":"google","description":"Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves.","archived":true,"fork":false,"pushed_at":"2022-09-21T12:58:36.000Z","size":1475,"stargazers_count":279,"open_issues_count":3,"forks_count":41,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-01-07T16:08:13.637Z","etag":null,"topics":["go","hilbert","peano","space-filling-curves"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-06T15:50:00.000Z","updated_at":"2024-11-28T06:48:28.000Z","dependencies_parsed_at":"2022-08-17T23:30:27.091Z","dependency_job_id":null,"html_url":"https://github.com/google/hilbert","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fhilbert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fhilbert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fhilbert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fhilbert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/hilbert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581091,"owners_count":20314167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","hilbert","peano","space-filling-curves"],"created_at":"2024-07-30T20:01:15.055Z","updated_at":"2025-03-14T17:30:59.040Z","avatar_url":"https://github.com/google.png","language":"Go","funding_links":[],"categories":["Go","Data Structures and Algorithms","数据结构与算法","Uncategorized","数据结构","Data Structures","数据结构`go语言实现的数据结构与算法`","Generators","\u003cspan id=\"数据结构-data-structures\"\u003e数据结构 Data Structures\u003c/span\u003e"],"sub_categories":["Miscellaneous Data Structures and Algorithms","杂项数据结构和算法","Advanced Console UIs","标准 CLI","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Hilbert [![Build Status](https://img.shields.io/travis/google/hilbert.svg)](https://travis-ci.org/google/hilbert) [![Coverage](https://img.shields.io/coveralls/google/hilbert.svg)](https://coveralls.io/github/google/hilbert) [![Report card](https://goreportcard.com/badge/github.com/google/hilbert)](https://goreportcard.com/report/github.com/google/hilbert) [![GoDoc](https://godoc.org/github.com/google/hilbert?status.svg)](https://godoc.org/github.com/google/hilbert) [![Libraries.io](https://img.shields.io/librariesio/github/google/hilbert.svg)](https://libraries.io/github/google/hilbert)\n\n\nGo package for mapping values to and from space-filling curves, such as\n[Hilbert](https://en.wikipedia.org/wiki/Hilbert_curve) and [Peano](https://en.wikipedia.org/wiki/Peano_curve) curves.\n\n![Image of 8 by 8 Hilbert curve](images/hilbert.png)\n\n[Documentation available here](https://godoc.org/github.com/google/hilbert)\n\n*This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.*\n \n## How to use\n\nInstall:\n\n```bash\ngo get github.com/google/hilbert\n```\n\nExample:\n\n```go\nimport \"github.com/google/hilbert\"\n\t\n// Create a Hilbert curve for mapping to and from a 16 by 16 space.\ns, err := hilbert.NewHilbert(16)\n\n// Create a Peano curve for mapping to and from a 27 by 27 space.\n//s, err := hilbert.NewPeano(27)\n\n// Now map one dimension numbers in the range [0, N*N-1], to an x,y\n// coordinate on the curve where both x and y are in the range [0, N-1].\nx, y, err := s.Map(t)\n\n// Also map back from (x,y) to t.\nt, err := s.MapInverse(x, y)\n```\n\n## Demo\n\nThe demo directory contains an example on how to draw an images of Hilbert and Peano curves, as well\nas animations of varying sizes for both.\n\n```bash\ngo run $GOPATH/src/github.com/google/hilbert/demo/demo.go\n```\n\nand the following images are generated. \n\nSimple 8x8 Hibert curve:\n\n![8x8 Hilbert curve image](images/hilbert.png)\n\nSimple 9x9 Peano curve:\n\n![9x9 Hilbert curve image](images/peano.png)\n\nAnimation of Hibert curve with N in the range 1..8:\n\n![Hilbert curve animation](images/hilbert_animation.gif)\n\nAnimation of Peano curve with N in the range 1..6:\n\n![Peano curve animation](images/peano_animation.gif)\n\n## Licence (Apache 2)\n\n```\nCopyright 2015 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fhilbert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fhilbert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fhilbert/lists"}