[−][src]Struct crystal_packing::transform::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]
pub fn clone(&self) -> Transform2
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Transform2
[src]
impl Debug for Transform2
[src]
impl<'de> Deserialize<'de> for Transform2
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
pub fn mul(self, rhs: &'b Atom2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Atom2> for &'a Transform2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Atom2) -> Self::Output
[src]
impl<'b> Mul<&'b LJ2> for Transform2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b LJ2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b LJ2> for &'a Transform2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b LJ2) -> Self::Output
[src]
impl<'b> Mul<&'b Line2> for Transform2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Line2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Line2> for &'a Transform2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Line2) -> Self::Output
[src]
impl<'b> Mul<&'b Point<f64, U2>> for Transform2
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Point2<f64>) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Point<f64, U2>> for &'a Transform2
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Point2<f64>) -> Self::Output
[src]
impl<'b> Mul<&'b Transform2> for Atom2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Transform2> for &'a Atom2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'b> Mul<&'b Transform2> for Line2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Transform2> for &'a Line2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'b> Mul<&'b Transform2> for LJ2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Transform2> for &'a LJ2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'b> Mul<&'b Transform2> for Transform2
[src]
type Output = Transform2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Transform2> for &'a Transform2
[src]
type Output = Transform2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: &'b Transform2) -> Self::Output
[src]
impl Mul<Atom2> for Transform2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Atom2) -> Self::Output
[src]
impl<'a> Mul<Atom2> for &'a Transform2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Atom2) -> Self::Output
[src]
impl Mul<LJ2> for Transform2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: LJ2) -> Self::Output
[src]
impl<'a> Mul<LJ2> for &'a Transform2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: LJ2) -> Self::Output
[src]
impl Mul<Line2> for Transform2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Line2) -> Self::Output
[src]
impl<'a> Mul<Line2> for &'a Transform2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Line2) -> Self::Output
[src]
impl Mul<Point<f64, U2>> for Transform2
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Point2<f64>) -> Self::Output
[src]
impl<'a> Mul<Point<f64, U2>> for &'a Transform2
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Point2<f64>) -> Self::Output
[src]
impl Mul<Transform2> for Atom2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl<'a> Mul<Transform2> for &'a Atom2
[src]
type Output = Atom2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl Mul<Transform2> for Line2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl<'a> Mul<Transform2> for &'a Line2
[src]
type Output = Line2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl Mul<Transform2> for LJ2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl<'a> Mul<Transform2> for &'a LJ2
[src]
type Output = LJ2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl Mul<Transform2> for Transform2
[src]
type Output = Transform2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl<'a> Mul<Transform2> for &'a Transform2
[src]
type Output = Transform2
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Transform2) -> Self::Output
[src]
impl PartialEq<Transform2> for Transform2
[src]
pub fn eq(&self, other: &Transform2) -> bool
[src]
pub fn ne(&self, other: &Transform2) -> bool
[src]
impl Serialize for Transform2
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Transform2
[src]
impl ToSVG for Transform2
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform2
impl Send for Transform2
impl Sync for Transform2
impl Unpin for Transform2
impl UnwindSafe for Transform2
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,