[][src]Struct crystal_packing::transform::Transform2

pub struct Transform2(_);

Perform coordinate tranforms on a point in space

This allows for defining a transformation of a point in space and allow for translations, rotations, mirror planes, and any combination of the above.

Rotations and translations are the most common method with a simple construction, and when they are the only transformations present this is known as an Isometric transform, or Isometry. Which is a rotation, followed by a translation

use crystal_packing::Transform2;
// Create a transform
let t = Transform2::new(0., (1., 1.));

The order of rotation, followed by translation is followed in the initialisation, with the angular rotation being the first argument, and the translation being the second argument.

Implementations

impl Transform2[src]

pub fn new(rotation: f64, translation: (f64, f64)) -> Transform2[src]

pub fn identity() -> Self[src]

pub fn position(&self) -> Point2<f64>[src]

pub fn get_translation(&self) -> Translation2<f64>[src]

pub fn set_position(self, position: Point2<f64>) -> Transform2[src]

pub fn periodic(&self, period: f64, offset: f64) -> Transform2[src]

pub fn from_operations(sym_ops: &str) -> Result<Transform2, Error>[src]

Convert the string representation of a symmetry operation to a vector.

This converts the string representation of an operation to a Transform, extracting the rotation and translation components.

use crystal_packing::{Transform2};
let t2 = Transform2::from_operations("-x, y");

Trait Implementations

impl Clone for Transform2[src]

impl Copy for Transform2[src]

impl Debug for Transform2[src]

impl<'de> Deserialize<'de> for Transform2[src]

impl From<Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>> for Transform2[src]

impl Into<Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>> for Transform2[src]

impl<'b> Mul<&'b Atom2> for Transform2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Atom2> for &'a Transform2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'b> Mul<&'b LJ2> for Transform2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b LJ2> for &'a Transform2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'b> Mul<&'b Line2> for Transform2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Line2> for &'a Transform2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'b> Mul<&'b Point<f64, U2>> for Transform2[src]

type Output = Point2<f64>

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Point<f64, U2>> for &'a Transform2[src]

type Output = Point2<f64>

The resulting type after applying the * operator.

impl<'b> Mul<&'b Transform2> for Atom2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Transform2> for &'a Atom2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'b> Mul<&'b Transform2> for Line2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Transform2> for &'a Line2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'b> Mul<&'b Transform2> for LJ2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Transform2> for &'a LJ2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'b> Mul<&'b Transform2> for Transform2[src]

type Output = Transform2

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Transform2> for &'a Transform2[src]

type Output = Transform2

The resulting type after applying the * operator.

impl Mul<Atom2> for Transform2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'a> Mul<Atom2> for &'a Transform2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl Mul<LJ2> for Transform2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'a> Mul<LJ2> for &'a Transform2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl Mul<Line2> for Transform2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'a> Mul<Line2> for &'a Transform2[src]

type Output = Line2

The resulting type after applying the * operator.

impl Mul<Point<f64, U2>> for Transform2[src]

type Output = Point2<f64>

The resulting type after applying the * operator.

impl<'a> Mul<Point<f64, U2>> for &'a Transform2[src]

type Output = Point2<f64>

The resulting type after applying the * operator.

impl Mul<Transform2> for Atom2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl<'a> Mul<Transform2> for &'a Atom2[src]

type Output = Atom2

The resulting type after applying the * operator.

impl Mul<Transform2> for Line2[src]

type Output = Line2

The resulting type after applying the * operator.

impl<'a> Mul<Transform2> for &'a Line2[src]

type Output = Line2

The resulting type after applying the * operator.

impl Mul<Transform2> for LJ2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl<'a> Mul<Transform2> for &'a LJ2[src]

type Output = LJ2

The resulting type after applying the * operator.

impl Mul<Transform2> for Transform2[src]

type Output = Transform2

The resulting type after applying the * operator.

impl<'a> Mul<Transform2> for &'a Transform2[src]

type Output = Transform2

The resulting type after applying the * operator.

impl PartialEq<Transform2> for Transform2[src]

impl Serialize for Transform2[src]

impl StructuralPartialEq for Transform2[src]

impl ToSVG for Transform2[src]

type Value = Use

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,