Macro geo_types::point

source ·
macro_rules! point {
    ( $($tag:tt : $val:expr),* $(,)? ) => { ... };
    ( $coord:expr $(,)? ) => { ... };
}
Expand description

Creates a Point from the given coordinates.

point! { x: <number>, y: <number> }
point!(<coordinate>)

§Examples

Creating a Point, supplying x/y values:

use geo_types::{point, coord};

let p = point! { x: 181.2, y: 51.79 };

assert_eq!(p.x(), 181.2);
assert_eq!(p.y(), 51.79);

let p = point!(coord! { x: 181.2, y: 51.79 });

assert_eq!(p.x(), 181.2);
assert_eq!(p.y(), 51.79);