pub struct Orientation { /* private fields */ }Expand description
A wafer cut and the beam angles. See the module docs for the conventions.
Implementations§
Source§impl Orientation
impl Orientation
Sourcepub fn new(
lattice: &Lattice,
normal_hkl: [i32; 3],
reference_uvw: [i32; 3],
tilt_rad: f64,
twist_rad: f64,
wafer_rotation_rad: f64,
) -> Result<Self, CrystalError>
pub fn new( lattice: &Lattice, normal_hkl: [i32; 3], reference_uvw: [i32; 3], tilt_rad: f64, twist_rad: f64, wafer_rotation_rad: f64, ) -> Result<Self, CrystalError>
Orientation of a wafer of lattice cut on (hkl) (inward normal)
with in-plane reference direction [uvw], and a beam at tilt_rad
(in [0, π/2)), twist_rad and wafer_rotation_rad (finite).
Sourcepub fn new_miller_bravais(
lattice: &Lattice,
normal_hkil: [i32; 4],
reference_uvtw: [i32; 4],
tilt_rad: f64,
twist_rad: f64,
wafer_rotation_rad: f64,
) -> Result<Self, CrystalError>
pub fn new_miller_bravais( lattice: &Lattice, normal_hkil: [i32; 4], reference_uvtw: [i32; 4], tilt_rad: f64, twist_rad: f64, wafer_rotation_rad: f64, ) -> Result<Self, CrystalError>
As Self::new for a hexagonal lattice, with the surface plane
(hkil) and the reference direction [uvtw] in four-index
(Miller-Bravais) notation. They are converted to three-index form by
super::lattice::plane_from_hkil and
super::lattice::direction_from_uvtw (convention in the
super::lattice module docs), and those are what
Self::normal_hkl and Self::reference_uvw return. The zone law
in three-index form is equivalent to h u + k v + i t + l w = 0.
§Errors
CrystalError::NotHexagonal for a cubic lattice,
CrystalError::InvalidMillerBravais for indices that break their
constraint, and the errors of Self::new.
Sourcepub fn normal_hkl(&self) -> [i32; 3]
pub fn normal_hkl(&self) -> [i32; 3]
Miller indices of the surface plane (inward normal).
Sourcepub fn reference_uvw(&self) -> [i32; 3]
pub fn reference_uvw(&self) -> [i32; 3]
Indices of the in-plane reference direction.
Sourcepub fn wafer_rotation_rad(&self) -> f64
pub fn wafer_rotation_rad(&self) -> f64
Wafer rotation, radians.
Sourcepub fn crystal_to_lab(&self) -> Mat3
pub fn crystal_to_lab(&self) -> Mat3
Crystal-to-lab rotation M = R_x(ω) B.
Sourcepub fn lab_to_crystal(&self) -> Mat3
pub fn lab_to_crystal(&self) -> Mat3
Lab-to-crystal rotation, the transpose of Self::crystal_to_lab.
Sourcepub fn to_crystal(&self, v_lab: [f64; 3]) -> [f64; 3]
pub fn to_crystal(&self, v_lab: [f64; 3]) -> [f64; 3]
Rotate a lab-frame vector into the crystal frame.
Sourcepub fn to_lab(&self, v_crystal: [f64; 3]) -> [f64; 3]
pub fn to_lab(&self, v_crystal: [f64; 3]) -> [f64; 3]
Rotate a crystal-frame vector into the lab frame.
Sourcepub fn beam_lab(&self) -> [f64; 3]
pub fn beam_lab(&self) -> [f64; 3]
Unit beam direction in the lab frame, lab_direction of the tilt
and twist.
Sourcepub fn beam_crystal(&self) -> [f64; 3]
pub fn beam_crystal(&self) -> [f64; 3]
Unit beam direction in the crystal frame.
Trait Implementations§
Source§impl Clone for Orientation
impl Clone for Orientation
Source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Orientation
Source§impl Debug for Orientation
impl Debug for Orientation
Source§impl PartialEq for Orientation
impl PartialEq for Orientation
impl StructuralPartialEq for Orientation
Auto Trait Implementations§
impl Freeze for Orientation
impl RefUnwindSafe for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Unpin for Orientation
impl UnsafeUnpin for Orientation
impl UnwindSafe for Orientation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more