Skip to content

Commit

Permalink
Merge pull request #118 from isaacbrodsky/lon-range-readme
Browse files Browse the repository at this point in the history
Update examples and docs for longitude range change (#93)
  • Loading branch information
isaacbrodsky committed Aug 15, 2018
2 parents aeaf21f + a3b46d1 commit 23a7fcf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The public API of this library consists of the functions declared in file
[h3api.h](./src/h3lib/include/h3api.h).

## [Unreleased]
### Changed
- Longitude outputs are now guaranteed to be in the range [-Pi, Pi]. (#93)

## [3.1.0] - 2018-08-03
### Added
Expand Down
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ This will produce the vertices of the hexagon at this location:
```
8a2a1072b59ffff
{
40.690058601 285.955848238
40.689907695 285.954938208
40.689270936 285.954658582
40.688785091 285.955288969
40.688935993 285.956198979
40.689572744 285.956478623
}
```
40.690058601 -74.044151762
40.689907695 -74.045061792
40.689270936 -74.045341418
40.688785091 -74.044711031
40.688935993 -74.043801021
40.689572744 -74.043521377
}```

You can get the center coordinate of the hexagon like so:

Expand All @@ -125,7 +124,7 @@ You can get the center coordinate of the hexagon like so:
This will produce some coordinate:

```
40.6894218437 285.9555686001
40.6894218437 -74.0444313999
```

### From C
Expand All @@ -141,13 +140,13 @@ You should get output like:

```
The index is: 8a2a1072b59ffff
Boundary vertex #0: 40.690059, 285.955848
Boundary vertex #1: 40.689908, 285.954938
Boundary vertex #2: 40.689271, 285.954659
Boundary vertex #3: 40.688785, 285.955289
Boundary vertex #4: 40.688936, 285.956199
Boundary vertex #5: 40.689573, 285.956479
Center coordinates: 40.689422, 285.955569
Boundary vertex #0: 40.690059, -74.044152
Boundary vertex #1: 40.689908, -74.045062
Boundary vertex #2: 40.689271, -74.045341
Boundary vertex #3: 40.688785, -74.044711
Boundary vertex #4: 40.688936, -74.043801
Boundary vertex #5: 40.689573, -74.043521
Center coordinates: 40.689422, -74.044431
```

## Contributing
Expand Down
6 changes: 3 additions & 3 deletions examples/distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ int main(int argc, char *argv[]) {
radsToDegs(geoHQ2.lon), h3Distance(h3HQ1, h3HQ2),
haversineDistance(geoHQ1.lat, geoHQ1.lon, geoHQ2.lat, geoHQ2.lon));
// Output:
// origin: (37.775236, 237.580245)
// destination: (37.789991, 237.597879)
// origin: (37.775236, -122.419755)
// destination: (37.789991, -122.402121)
// grid distance: 2340
// distance in km: 2.256850km
// distance in km: 2.256853km
}
4 changes: 4 additions & 0 deletions examples/edge.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ int main(int argc, char *argv[]) {
radsToDegs(boundary.verts[v].lat),
radsToDegs(boundary.verts[v].lon));
}
// Output:
// The edge is 16a2a1072b59ffff
// Edge vertex #0: 40.690059, -74.044152
// Edge vertex #1: 40.689908, -74.045062
}

0 comments on commit 23a7fcf

Please sign in to comment.