[−][src]Trait geo::algorithm::translate::Translate
Required methods
pub fn translate(&self, xoff: T, yoff: T) -> Self where
T: CoordinateType,
[src]
T: CoordinateType,
Translate a Geometry along its axes by the given offsets
Examples
use geo::algorithm::translate::Translate; use geo::line_string; let ls = line_string![ (x: 0.0, y: 0.0), (x: 5.0, y: 5.0), (x: 10.0, y: 10.0), ]; let translated = ls.translate(1.5, 3.5); assert_eq!(translated, line_string![ (x: 1.5, y: 3.5), (x: 6.5, y: 8.5), (x: 11.5, y: 13.5), ]);
pub fn translate_inplace(&mut self, xoff: T, yoff: T) where
T: CoordinateType,
[src]
T: CoordinateType,
Translate a Geometry along its axes, but in place.
Implementors
impl<T, G> Translate<T> for G where
T: CoordinateType,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
[src]
T: CoordinateType,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,