pub struct Axis {
pub point: Vector3,
pub direction: Vector3,
}Expand description
A straight line: through point, along the unit vector direction.
Fields§
§point: Vector3§direction: Vector3Implementations§
Source§impl Axis
impl Axis
Sourcepub fn try_new(point: Vector3, direction: Vector3) -> GeopResult<Self>
pub fn try_new(point: Vector3, direction: Vector3) -> GeopResult<Self>
The line through point along direction, which need not be unit
length but must not be zero.
Sourcepub fn project(&self, p: &Vector3) -> Vector3
pub fn project(&self, p: &Vector3) -> Vector3
The point of the line closest to p: the foot of the perpendicular
from p.
Sourcepub fn could_contain(&self, p: &Vector3) -> bool
pub fn could_contain(&self, p: &Vector3) -> bool
Whether p could lie on the line.
Sourcepub fn could_be_parallel(&self, other: &Axis) -> bool
pub fn could_be_parallel(&self, other: &Axis) -> bool
Whether other could run parallel to this line, either way.
Sourcepub fn nearest(&self, other: &Axis) -> GeopResult<Vector3>
pub fn nearest(&self, other: &Axis) -> GeopResult<Vector3>
Where the two lines come closest: halfway between the point of each nearest the other — where they cross, if they do. Fails if they could be parallel: then every point is as near as any other.
Trait Implementations§
impl StructuralPartialEq for Axis
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnsafeUnpin for Axis
impl UnwindSafe for Axis
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