Skip to main content

PgaLine

Struct PgaLine 

Source
#[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: f32

Implementations§

Source§

impl PgaLine

Source

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.

Source

pub const fn from_direction_and_moment(dir: [f32; 3], mom: [f32; 3]) -> Self

Constructs a Plücker line from direction and moment arrays.

Source

pub const fn x_axis() -> Self

Canonical X axis line through origin.

Source

pub const fn y_axis() -> Self

Canonical Y axis line through origin.

Source

pub const fn z_axis() -> Self

Canonical Z axis line through origin.

Source

pub fn from_point_and_direction(point: &[f32; 3], dir: &[f32; 3]) -> Self

Constructs a line through a point with a given direction.

Source

pub const fn direction(&self) -> [f32; 3]

Direction vector [vx, vy, vz].

Source

pub const fn moment(&self) -> [f32; 3]

Moment vector [mx, my, mz].

Source

pub fn norm(&self) -> f32

Direction norm ||v||.

Source

pub fn normalized(&self) -> Self

Returns a normalized line with unit direction ||v|| = 1.

Source

pub fn closest_point_to_origin(&self) -> PgaPoint

Returns the point on the line closest to the coordinate origin.

Source

pub fn project_point(&self, p: &PgaPoint) -> PgaPoint

Orthogonal projection of an affine point onto the line.

Source

pub fn distance_to_point(&self, p: &PgaPoint) -> f32

Perpendicular distance from an affine point to the line.

Source

pub fn meet_plane(&self, plane: &PgaPlane) -> PgaPoint

Computes the intersection point between this line and a plane (meet \vee).

Trait Implementations§

Source§

impl Add for PgaLine

Source§

type Output = PgaLine

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl Clone for PgaLine

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PgaLine

Source§

impl Debug for PgaLine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PgaLine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Div<f32> for PgaLine

Source§

type Output = PgaLine

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Self

Performs the / operation. Read more
Source§

impl Mul<f32> for PgaLine

Source§

type Output = PgaLine

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self

Performs the * operation. Read more
Source§

impl Neg for PgaLine

Source§

type Output = PgaLine

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl PartialEq for PgaLine

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PgaLine

Source§

impl Sub for PgaLine

Source§

type Output = PgaLine

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.