#geo #polygon #raycasting

geo-raycasting

Ray Casting algorithm for the geo crate

5 unstable releases

0.3.0 Jan 20, 2021
0.2.0 Oct 21, 2020
0.1.2 Oct 27, 2019
0.1.1 Oct 27, 2019
0.1.0 Oct 24, 2019

#826 in Algorithms

Download history 245/week @ 2023-10-18 254/week @ 2023-10-25 167/week @ 2023-11-01 215/week @ 2023-11-08 216/week @ 2023-11-15 279/week @ 2023-11-22 364/week @ 2023-11-29 165/week @ 2023-12-06 299/week @ 2023-12-13 194/week @ 2023-12-20 83/week @ 2023-12-27 305/week @ 2024-01-03 280/week @ 2024-01-10 220/week @ 2024-01-17 64/week @ 2024-01-24 156/week @ 2024-01-31

784 downloads per month

Apache-2.0/MIT

10KB
152 lines

geo-raycasting

A simple implementation of Ray Casting algorithm for geo crate, inspired by the code found on https://rosettacode.org/wiki/Ray-casting_algorithm

Example:

use geo_raycasting::RayCasting;

use geo_types::LineString;

fn main() {
    let poly_square: LineString<f64> = vec![(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0), (0.0, 0.0)].into();
    assert!(poly_square.within(&(5.0, 5.0).into()));
}

lib.rs:

geo-raycasting

Ray Casting algorithm for the geo crate

Dependencies

~755KB
~15K SLoC