Trait geo::algorithm::rotate::Rotate [−][src]
Required methods
fn rotate(&self, angle: T) -> Self where
T: CoordFloat,
[src]
T: CoordFloat,
Rotate a Geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
Units
angle
: degrees
Examples
use geo::algorithm::rotate::Rotate; use geo::line_string; let line_string = line_string![ (x: 0.0, y: 0.0), (x: 5.0, y: 5.0), (x: 10.0, y: 10.0), ]; let rotated = line_string.rotate(-45.0); let expected = line_string![ (x: -2.0710678118654755, y: 5.0), (x: 5.0, y: 5.0), (x: 12.071067811865476, y: 5.0), ]; assert_eq!(expected, rotated);
Implementors
impl<T> Rotate<T> for Line<T> where
T: CoordFloat,
[src]
T: CoordFloat,
impl<T> Rotate<T> for LineString<T> where
T: CoordFloat,
[src]
T: CoordFloat,
fn rotate(&self, angle: T) -> Self
[src]
Rotate the LineString about its centroid by the given number of degrees
impl<T> Rotate<T> for MultiLineString<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn rotate(&self, angle: T) -> Self
[src]
Rotate the contained LineStrings about their centroids by the given number of degrees
impl<T> Rotate<T> for MultiPoint<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn rotate(&self, angle: T) -> Self
[src]
Rotate the contained Points about their centroids by the given number of degrees
impl<T> Rotate<T> for MultiPolygon<T> where
T: CoordFloat + FromPrimitive + Sum,
[src]
T: CoordFloat + FromPrimitive + Sum,
fn rotate(&self, angle: T) -> Self
[src]
Rotate the contained Polygons about their centroids by the given number of degrees
impl<T> Rotate<T> for Point<T> where
T: CoordFloat,
[src]
T: CoordFloat,
fn rotate(&self, _angle: T) -> Self
[src]
Rotate the Point about itself by the given number of degrees This operation leaves the point coordinates unchanged
impl<T> Rotate<T> for Polygon<T> where
T: CoordFloat + FromPrimitive + Sum,
[src]
T: CoordFloat + FromPrimitive + Sum,