Struct geo::Line
[−]
[src]
pub struct Line<T> where
T: Float, { pub start: Point<T>, pub end: Point<T>, }
Fields
start: Point<T>
end: Point<T>
Methods
impl<T> Line<T> where
T: Float,
[src]
T: Float,
fn new(start: Point<T>, end: Point<T>) -> Line<T>
Creates a new line segment.
use geo::{Point, Line}; let line = Line::new(Point::new(0., 0.), Point::new(1., 2.)); assert_eq!(line.start, Point::new(0., 0.)); assert_eq!(line.end, Point::new(1., 2.));
Trait Implementations
impl<T: PartialEq> PartialEq for Line<T> where
T: Float,
[src]
T: Float,
fn eq(&self, __arg_0: &Line<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Line<T>) -> bool
This method tests for !=
.
impl<T: Clone> Clone for Line<T> where
T: Float,
[src]
T: Float,
fn clone(&self) -> Line<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Centroid<T> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Contains<Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, p: &Point<T>) -> bool
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<Line<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, line: &Line<T>) -> bool
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<LineString<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, linestring: &LineString<T>) -> bool
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Intersects<Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, p: &Point<T>) -> bool
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Line<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, line: &Line<T>) -> bool
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<LineString<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, linestring: &LineString<T>) -> bool
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Polygon<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, p: &Polygon<T>) -> bool
Checks if the geometry A intersects the geometry B. Read more
impl<T> Area<T> for Line<T> where
T: Float,
[src]
T: Float,
fn area(&self) -> T
Area of polygon. See: https://en.wikipedia.org/wiki/Polygon Read more
impl<T> Length<T> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Distance<T, Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> BoundingBox<T> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Rotate<T> for Line<T> where
T: Float,
[src]
T: Float,
fn rotate(&self, angle: T) -> Self
Rotate a Geometry around its centroid by an angle, in degrees Read more
impl<T> RotatePoint<T> for Line<T> where
T: Float,
[src]
T: Float,
fn rotate_around_point(&self, angle: T, point: &Point<T>) -> Self
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more