pub struct Velocity {
pub vx: Real,
pub vy: Real,
pub vz: Real,
}Expand description
A 3-dimensional velocity vector expressed in Cartesian coordinates (vx, vy, vz) with units of meters per second (SI).
Fields§
§vx: Real§vy: Real§vz: RealImplementations§
Source§impl Velocity
impl Velocity
pub const ZERO: Self
Sourcepub const fn new(vx: Real, vy: Real, vz: Real) -> Self
pub const fn new(vx: Real, vy: Real, vz: Real) -> Self
Creates a new Velocity directly from its Cartesian components in m/s.
Sourcepub const fn from_speed(speed_m_s: Real) -> Self
pub const fn from_speed(speed_m_s: Real) -> Self
Creates a Velocity from its scalar speed (magnitude) in m/s.
Direction is set along the x-axis because only the speed matters
for relativistic calculations (beta(), norm_squared(), etc.).
This is the convenience constructor used by Drift::from_velocity_potential_and_scale.
Sourcepub const fn norm_squared(self) -> Real
pub const fn norm_squared(self) -> Real
Returns the squared Euclidean norm (v²).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Velocity
impl<'de> Deserialize<'de> for Velocity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Tsify for Velocity
impl Tsify for Velocity
const DECL: &'static str = "/**\n * A 3-dimensional velocity vector expressed in Cartesian coordinates (vx, vy, vz)\n * with units of meters per second (SI).\n */\nexport interface Velocity {\n vx: Real;\n vy: Real;\n vz: Real;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
impl Copy for Velocity
impl StructuralPartialEq for Velocity
Auto Trait Implementations§
impl Freeze for Velocity
impl RefUnwindSafe for Velocity
impl Send for Velocity
impl Sync for Velocity
impl Unpin for Velocity
impl UnsafeUnpin for Velocity
impl UnwindSafe for Velocity
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
Mutably borrows from an owned value. Read more