Skip to content

Commit

Permalink
prepare init release
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Nov 20, 2022
1 parent dc227b8 commit 2b3bcb0
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,55 @@

Rewrite parts of [tidwall/geometry](https://github.com/tidwall/geometry) to Rust
for [ringsaturn/tzf-rs](https://github.com/ringsaturn/tzf-rs).

```toml
[dependencies]
geometry-rs = { git = "http://github.com/ringsaturn/geometry-rs", tag = "v0.1.0"}
```

```rust
use std::vec;

use geometry_rs;

fn main() {
let poly = geometry_rs::Polygon::new(
vec![
geometry_rs::Point {
x: 90.48826291293898,
y: 45.951129815858565,
},
geometry_rs::Point {
x: 90.48826291293898,
y: 27.99437617512571,
},
geometry_rs::Point {
x: 122.83201291294,
y: 27.99437617512571,
},
geometry_rs::Point {
x: 122.83201291294,
y: 45.951129815858565,
},
geometry_rs::Point {
x: 90.48826291293898,
y: 45.951129815858565,
},
],
vec![],
);

let p_out = geometry_rs::Point {
x: 130.74216916294148,
y: 37.649011392900306,
};

print!("{:?}\n", poly.contains_point(p_out));

let p_in = geometry_rs::Point {
x: 99.9804504129416,
y: 39.70716466970461,
};
print!("{:?}\n", poly.contains_point(p_in));
}
```

0 comments on commit 2b3bcb0

Please sign in to comment.