Struct geo::Line [] [src]

pub struct Line<T> where
    T: CoordinateType
{ pub start: Point<T>, pub end: Point<T>, }

A line segment made up of exactly two Points

Fields

Methods

impl<T> Line<T> where
    T: CoordinateType
[src]

[src]

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: CoordinateType
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Clone> Clone for Line<T> where
    T: CoordinateType
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy> Copy for Line<T> where
    T: CoordinateType
[src]

impl<T: Debug> Debug for Line<T> where
    T: CoordinateType
[src]

[src]

Formats the value using the given formatter. Read more

impl<T> SpatialObject for Line<T> where
    T: Float + SpadeNum + Debug
[src]

The object's point type.

[src]

Returns the object's minimal bounding rectangle. Read more

[src]

Returns the squared euclidean distance from the object's contour. Returns a value samller than zero if the point is contained within the object. Read more

[src]

Returns true if a given point is contained in this object.

impl<T> Centroid<T> for Line<T> where
    T: Float
[src]

[src]

See: https://en.wikipedia.org/wiki/Centroid Read more

impl<T> Contains<Point<T>> for Line<T> where
    T: Float
[src]

[src]

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]

[src]

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]

[src]

Checks if the geometry A is completely inside the B geometry. Read more

impl<T> Contains<Line<T>> for LineString<T> where
    T: Float
[src]

[src]

Checks if the geometry A is completely inside the B geometry. Read more

impl<T> Contains<Line<T>> for Polygon<T> where
    T: Float
[src]

[src]

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]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<Line<T>> for Point<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<Line<T>> for Line<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<LineString<T>> for Line<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<Line<T>> for LineString<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<Polygon<T>> for Line<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Intersects<Line<T>> for Polygon<T> where
    T: Float
[src]

[src]

Checks if the geometry A intersects the geometry B. Read more

impl<T> Area<T> for Line<T> where
    T: Float
[src]

[src]

Area of polygon. See: https://en.wikipedia.org/wiki/Polygon Read more

impl<T> EuclideanLength<T> for Line<T> where
    T: Float
[src]

[src]

Calculation of the length of a Line Read more

impl<T> EuclideanDistance<T, Point<T>> for Line<T> where
    T: Float
[src]

[src]

Minimum distance from a Line to a Point

impl<T> EuclideanDistance<T, Line<T>> for Point<T> where
    T: Float
[src]

[src]

Minimum istance from a Line to a Point

impl<T> BoundingBox<T> for Line<T> where
    T: CoordinateType
[src]

[src]

Return the Bounding Box of a geometry Read more

impl<T> Rotate<T> for Line<T> where
    T: Float
[src]

[src]

Rotate a Geometry around its centroid by an angle, in degrees Read more

impl<T: CoordinateType, NT: CoordinateType> MapCoords<T, NT> for Line<T>
[src]

[src]

Apply a function to all the coordinates in a geometric object, returning a new object. Read more

impl<T: CoordinateType, NT: CoordinateType> TryMapCoords<T, NT> for Line<T>
[src]

[src]

Map a fallible function over all the coordinates in a geometry, returning a Result Read more

impl<T: CoordinateType> MapCoordsInplace<T> for Line<T>
[src]

[src]

Apply a function to all the coordinates in a geometric object, in place Read more

impl<F: Float> ClosestPoint<F> for Line<F>
[src]

[src]

Find the closest point between self and p.

impl<T> HaversineLength<T> for Line<T> where
    T: Float + FromPrimitive
[src]

[src]

Calculation of the length of a Line Read more

Auto Trait Implementations

impl<T> Send for Line<T> where
    T: Send

impl<T> Sync for Line<T> where
    T: Sync