#[repr(C, align(32))]pub struct PgaLine {
pub vx: f32,
pub vy: f32,
pub vz: f32,
pub mx: f32,
pub my: f32,
pub mz: f32,
pub _pad0: f32,
pub _pad1: f32,
}Expand description
Line in 3D Projective Geometric Algebra Cl*(3, 0, 1) (Plücker bivector). Composed of Euclidean direction (vx, vy, vz) and moment (mx, my, mz) about origin. Plücker condition: vxmx + vymy + vz*mz = 0.
Fields§
§vx: f32§vy: f32§vz: f32§mx: f32§my: f32§mz: f32§_pad0: f32§_pad1: f32Implementations§
Source§impl PgaLine
impl PgaLine
Sourcepub const fn new(vx: f32, vy: f32, vz: f32, mx: f32, my: f32, mz: f32) -> Self
pub const fn new(vx: f32, vy: f32, vz: f32, mx: f32, my: f32, mz: f32) -> Self
Constructs a Plücker line from direction and moment components.
Sourcepub const fn from_direction_and_moment(dir: [f32; 3], mom: [f32; 3]) -> Self
pub const fn from_direction_and_moment(dir: [f32; 3], mom: [f32; 3]) -> Self
Constructs a Plücker line from direction and moment arrays.
Sourcepub fn from_point_and_direction(point: &[f32; 3], dir: &[f32; 3]) -> Self
pub fn from_point_and_direction(point: &[f32; 3], dir: &[f32; 3]) -> Self
Constructs a line through a point with a given direction.
Sourcepub fn normalized(&self) -> Self
pub fn normalized(&self) -> Self
Returns a normalized line with unit direction ||v|| = 1.
Sourcepub fn closest_point_to_origin(&self) -> PgaPoint
pub fn closest_point_to_origin(&self) -> PgaPoint
Returns the point on the line closest to the coordinate origin.
Sourcepub fn project_point(&self, p: &PgaPoint) -> PgaPoint
pub fn project_point(&self, p: &PgaPoint) -> PgaPoint
Orthogonal projection of an affine point onto the line.
Sourcepub fn distance_to_point(&self, p: &PgaPoint) -> f32
pub fn distance_to_point(&self, p: &PgaPoint) -> f32
Perpendicular distance from an affine point to the line.
Sourcepub fn meet_plane(&self, plane: &PgaPlane) -> PgaPoint
pub fn meet_plane(&self, plane: &PgaPlane) -> PgaPoint
Computes the intersection point between this line and a plane (meet \vee).
Trait Implementations§
impl Copy for PgaLine
impl StructuralPartialEq for PgaLine
Auto Trait Implementations§
impl Forget for PgaLine
impl Freeze for PgaLine
impl Move for PgaLine
impl RefUnwindSafe for PgaLine
impl Send for PgaLine
impl Sync for PgaLine
impl Unpin for PgaLine
impl UnsafeUnpin for PgaLine
impl UnwindSafe for PgaLine
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