pub struct Ray2 { /* private fields */ }Expand description
A half-infinite 2D ray.
Implementations§
Source§impl Ray2
impl Ray2
Sourcepub const fn new(origin: Point2, direction: Vector<2>) -> Ray2
pub const fn new(origin: Point2, direction: Vector<2>) -> Ray2
Creates a ray without validation.
Sourcepub fn try_new(
origin: Point2,
direction: Vector<2>,
) -> Result<Ray2, GeometryError>
pub fn try_new( origin: Point2, direction: Vector<2>, ) -> Result<Ray2, GeometryError>
Creates a ray with a finite origin and finite non-zero direction.
§Errors
Returns a GeometryError when the origin is non-finite or the direction is invalid.
Trait Implementations§
impl Copy for Ray2
impl StructuralPartialEq for Ray2
Auto Trait Implementations§
impl Freeze for Ray2
impl RefUnwindSafe for Ray2
impl Send for Ray2
impl Sync for Ray2
impl Unpin for Ray2
impl UnsafeUnpin for Ray2
impl UnwindSafe for Ray2
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