Type Alias lowdim::Point2d

source ·
pub type Point2d<S = i64> = Point<S, Vec2d<S>>;
Expand description

A 2d point.

Aliased Type§

struct Point2d<S = i64> { /* private fields */ }

Implementations§

source§

impl<S: Integer> Point2d<S>

source

pub fn new(x: S, y: S) -> Self

Creates a new point with the given coordinates.

source

pub fn x(&self) -> S

Returns the x coordinate of the point.

Examples
let p = p2d(2, 3);
assert_eq!(2, p.x());
source

pub fn y(&self) -> S

Returns the y coordinate of the point.

Examples
let p = p2d(2, 3);
assert_eq!(3, p.y());