Struct LineEquation
pub struct LineEquation<S> { /* private fields */ }
Available on crate feature
canvas
only.Expand description
A line defined by the equation
a * x + b * y + c = 0; a * a + b * b = 1
.
Implementations§
§impl<S> LineEquation<S>where
S: Scalar,
impl<S> LineEquation<S>where
S: Scalar,
pub fn new(a: S, b: S, c: S) -> LineEquation<S>
pub fn a(&self) -> S
pub fn b(&self) -> S
pub fn c(&self) -> S
pub fn project_point( &self, p: &Point2D<S, UnknownUnit>, ) -> Point2D<S, UnknownUnit>
pub fn signed_distance_to_point(&self, p: &Point2D<S, UnknownUnit>) -> S
pub fn distance_to_point(&self, p: &Point2D<S, UnknownUnit>) -> S
pub fn invert(&self) -> LineEquation<S>
pub fn parallel_line(&self, p: &Point2D<S, UnknownUnit>) -> LineEquation<S>
pub fn offset(&self, d: S) -> LineEquation<S>
pub fn tangent(&self) -> Vector2D<S, UnknownUnit>
pub fn normal(&self) -> Vector2D<S, UnknownUnit>
pub fn solve_y_for_x(&self, x: S) -> Option<S>
pub fn solve_x_for_y(&self, y: S) -> Option<S>
pub fn is_horizontal(&self) -> bool
pub fn is_vertical(&self) -> bool
Trait Implementations§
§impl<S> Clone for LineEquation<S>where
S: Clone,
impl<S> Clone for LineEquation<S>where
S: Clone,
§fn clone(&self) -> LineEquation<S>
fn clone(&self) -> LineEquation<S>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<S> Debug for LineEquation<S>where
S: Debug,
impl<S> Debug for LineEquation<S>where
S: Debug,
§impl<S> PartialEq for LineEquation<S>where
S: PartialEq,
impl<S> PartialEq for LineEquation<S>where
S: PartialEq,
impl<S> Copy for LineEquation<S>where
S: Copy,
impl<S> Eq for LineEquation<S>where
S: Eq,
impl<S> StructuralPartialEq for LineEquation<S>
Auto Trait Implementations§
impl<S> Freeze for LineEquation<S>where
S: Freeze,
impl<S> RefUnwindSafe for LineEquation<S>where
S: RefUnwindSafe,
impl<S> Send for LineEquation<S>where
S: Send,
impl<S> Sync for LineEquation<S>where
S: Sync,
impl<S> Unpin for LineEquation<S>where
S: Unpin,
impl<S> UnwindSafe for LineEquation<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more