Struct g3::Branch

source ·
pub struct Branch(_);
Expand description

The Branch both a line through the origin and also the principal branch of the logarithm of a rotor.

The rotor branch will be most commonly constructed by taking the logarithm of a normalized rotor. The branch may then be linearily scaled to adjust the “strength” of the rotor, and subsequently re-exponentiated to create the adjusted rotor.

Implementations§

source§

impl Branch

source

pub const fn new(a: f32, b: f32, c: f32) -> Branch

Construct the branch as the following multivector:

$$a \mathbf{e}{23} + b\mathbf{e}{31} + c\mathbf{e}_{12}$$

To convince yourself this is a line through the origin, remember that such a line can be generated using the geometric product of two planes through the origin.

source

pub fn squared_norm(self) -> f32

If a line is constructed as the regressive product (join) of two points, the squared norm provided here is the squared distance between the two points (provided the points are normalized). Returns $d^2 + e^2 + f^2$.

source

pub fn norm(self) -> f32

Returns the square root of the quantity produced by squared_norm.

source

pub fn normalized(self) -> Branch

source

pub fn inverse(self) -> Branch

source

pub fn exp(self) -> Rotor

Exponentiate a branch to produce a rotor.

source

pub fn sqrt(self) -> Rotor

source

pub fn reverse(self) -> Branch

Reversion

source

pub fn e12(&self) -> f32

source

pub fn e21(&self) -> f32

source

pub fn z(&self) -> f32

source

pub fn e31(&self) -> f32

source

pub fn e13(&self) -> f32

source

pub fn y(&self) -> f32

source

pub fn e23(&self) -> f32

source

pub fn e32(&self) -> f32

source

pub fn x(&self) -> f32

Trait Implementations§

source§

impl Add<Branch> for Branch

§

type Output = Branch

The resulting type after applying the + operator.
source§

fn add(self, b: Branch) -> Branch

Performs the + operation. Read more
source§

impl AddAssign<Branch> for Branch

source§

fn add_assign(&mut self, b: Self)

Performs the += operation. Read more
source§

impl BitAnd<Branch> for Point

§

type Output = Plane

The resulting type after applying the & operator.
source§

fn bitand(self, b: Branch) -> Plane

Performs the & operation. Read more
source§

impl BitAnd<Point> for Branch

§

type Output = Plane

The resulting type after applying the & operator.
source§

fn bitand(self, a: Point) -> Plane

Performs the & operation. Read more
source§

impl BitXor<Branch> for Horizon

§

type Output = Dual

The resulting type after applying the ^ operator.
source§

fn bitxor(self, b: Branch) -> Dual

Performs the ^ operation. Read more
source§

impl BitXor<Branch> for Line

§

type Output = Dual

The resulting type after applying the ^ operator.
source§

fn bitxor(self, b: Branch) -> Dual

Performs the ^ operation. Read more
source§

impl BitXor<Branch> for Plane

§

type Output = Point

The resulting type after applying the ^ operator.
source§

fn bitxor(self, b: Branch) -> Point

Performs the ^ operation. Read more
source§

impl BitXor<Horizon> for Branch

§

type Output = Dual

The resulting type after applying the ^ operator.
source§

fn bitxor(self, l: Horizon) -> Dual

Performs the ^ operation. Read more
source§

impl BitXor<Line> for Branch

§

type Output = Dual

The resulting type after applying the ^ operator.
source§

fn bitxor(self, l: Line) -> Dual

Performs the ^ operation. Read more
source§

impl BitXor<Plane> for Branch

§

type Output = Point

The resulting type after applying the ^ operator.
source§

fn bitxor(self, p: Plane) -> Point

Performs the ^ operation. Read more
source§

impl Clone for Branch

source§

fn clone(&self) -> Branch

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Branch

source§

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

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

impl Default for Branch

source§

fn default() -> Branch

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

impl Div<Branch> for Branch

§

type Output = Rotor

The resulting type after applying the / operator.
source§

fn div(self, b: Branch) -> Rotor

Performs the / operation. Read more
source§

impl Div<f32> for Branch

§

type Output = Branch

The resulting type after applying the / operator.
source§

fn div(self, s: f32) -> Branch

Performs the / operation. Read more
source§

impl DivAssign<f32> for Branch

source§

fn div_assign(&mut self, s: f32)

Performs the /= operation. Read more
source§

impl From<&Line> for Branch

source§

fn from(l: &Line) -> Self

Converts to this type from the input type.
source§

impl From<Branch> for Line

source§

fn from(b: Branch) -> Self

Converts to this type from the input type.
source§

impl From<Line> for Branch

source§

fn from(l: Line) -> Self

Converts to this type from the input type.
source§

impl Mul<Branch> for Branch

§

type Output = Rotor

The resulting type after applying the * operator.
source§

fn mul(self, b: Branch) -> Rotor

Performs the * operation. Read more
source§

impl Mul<f32> for Branch

§

type Output = Branch

The resulting type after applying the * operator.
source§

fn mul(self, s: f32) -> Branch

Performs the * operation. Read more
source§

impl MulAssign<f32> for Branch

source§

fn mul_assign(&mut self, s: f32)

Performs the *= operation. Read more
source§

impl Neg for Branch

§

type Output = Branch

The resulting type after applying the - operator.
source§

fn neg(self) -> Branch

Performs the unary - operation. Read more
source§

impl Not for Branch

§

type Output = Horizon

The resulting type after applying the ! operator.
source§

fn not(self) -> Horizon

Performs the unary ! operation. Read more
source§

impl PartialEq<Branch> for Branch

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sub<Branch> for Branch

§

type Output = Branch

The resulting type after applying the - operator.
source§

fn sub(self, b: Branch) -> Branch

Performs the - operation. Read more
source§

impl SubAssign<Branch> for Branch

source§

fn sub_assign(&mut self, b: Self)

Performs the -= operation. Read more
source§

impl Copy for Branch

source§

impl StructuralPartialEq for Branch

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.