pub struct Quaternion {
pub x: f64,
pub y: f64,
pub z: f64,
pub w: f64,
}Expand description
A rotation — std/geometry/v1/Quaternion, stored xyzw (scalar last).
Fields§
§x: f64The x component of the vector part.
y: f64The y component of the vector part.
z: f64The z component of the vector part.
w: f64The scalar part.
Implementations§
Source§impl Quaternion
impl Quaternion
Sourcepub const fn new(x: f64, y: f64, z: f64, w: f64) -> Self
pub const fn new(x: f64, y: f64, z: f64, w: f64) -> Self
A quaternion from its components, in xyzw order.
Sourcepub fn is_normalized(self, tolerance: f64) -> bool
pub fn is_normalized(self, tolerance: f64) -> bool
Whether the quaternion is a unit rotation within tolerance.
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
The quaternion scaled to unit length, or Quaternion::IDENTITY when
it has no length to scale.
Trait Implementations§
Source§impl AstrsMessage for Quaternion
impl AstrsMessage for Quaternion
Source§const URN: &'static str = "std/geometry/v1/Quaternion"
const URN: &'static str = "std/geometry/v1/Quaternion"
The type URN this message’s columnar layout is declared against
(blueprint §24.3), e.g.
"std/vision/v1/Detections".Source§fn data_type() -> DataType
fn data_type() -> DataType
The columnar layout
AstrsMessage::to_record_batch produces and
AstrsMessage::from_record_batch expects.Source§fn to_record_batch(&self) -> Result<RecordBatch>
fn to_record_batch(&self) -> Result<RecordBatch>
Encodes one message into a one-row
RecordBatch (blueprint §6.1’s
“one record batch per message”). Read moreSource§fn from_record_batch(batch: &RecordBatch) -> Result<Self>
fn from_record_batch(batch: &RecordBatch) -> Result<Self>
Decodes one message from a one-row
RecordBatch. Read moreSource§fn schema() -> Schema
fn schema() -> Schema
The single-column
Schema wrapping AstrsMessage::data_type
under crate::DATA_COLUMN (blueprint §6.1).Source§fn type_urn() -> Result<TypeUrn, TypeUrnError>
fn type_urn() -> Result<TypeUrn, TypeUrnError>
Parses
AstrsMessage::URN. Read moreSource§impl Clone for Quaternion
impl Clone for Quaternion
impl Copy for Quaternion
Source§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Default for Quaternion
impl Default for Quaternion
Source§impl FromPayload for Quaternion
impl FromPayload for Quaternion
Source§fn from_batch(batch: &RecordBatch) -> Result<Self>
fn from_batch(batch: &RecordBatch) -> Result<Self>
Reads the value from a decoded payload batch. Read more
Source§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§impl PartialOrd for Quaternion
impl PartialOrd for Quaternion
impl StructuralPartialEq for Quaternion
Auto Trait Implementations§
impl Freeze for Quaternion
impl RefUnwindSafe for Quaternion
impl Send for Quaternion
impl Sync for Quaternion
impl Unpin for Quaternion
impl UnsafeUnpin for Quaternion
impl UnwindSafe for Quaternion
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more