Struct eschers::vector::Vector
[−]
[src]
Representation of two dimensional vector
Fields
x: T
x-coordinate of the vector
y: T
y-coordinate of the vector
Methods
impl<T> Vector<T> where
T: Copy + Add<Output = T> + Neg<Output = T> + Mul<Output = T>,
[src]
impl<T> Vector<T> where
T: Copy + Add<Output = T> + Neg<Output = T> + Mul<Output = T>,
pub fn new(x: T, y: T) -> Self
[src]
pub fn new(x: T, y: T) -> Self
Create a Vector
with Cartesian coordinates x
and y
pub fn add(&self, other: &Self) -> Self
[src]
pub fn add(&self, other: &Self) -> Self
Add other
component-wise to self
, returning a new Vector
pub fn neg(&self) -> Self
[src]
pub fn neg(&self) -> Self
Negate self
component-wise, returning a new Vector
pub fn sub(&self, other: &Self) -> Self
[src]
pub fn sub(&self, other: &Self) -> Self
Subtract other
component-wise from self
, returning a new Vector
pub fn scale(&self, factor: &T) -> Self
[src]
pub fn scale(&self, factor: &T) -> Self
Scale self
uniformly by factor
, returning a new Vector
impl Vector<f64>
[src]
impl Vector<f64>
Trait Implementations
impl<T: Debug> Debug for Vector<T> where
T: Clone + Copy,
[src]
impl<T: Debug> Debug for Vector<T> where
T: Clone + Copy,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq> PartialEq for Vector<T> where
T: Clone + Copy,
[src]
impl<T: PartialEq> PartialEq for Vector<T> where
T: Clone + Copy,
fn eq(&self, __arg_0: &Vector<T>) -> bool
[src]
fn eq(&self, __arg_0: &Vector<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector<T>) -> bool
[src]
fn ne(&self, __arg_0: &Vector<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Vector<T> where
T: Clone + Copy,
[src]
impl<T: Eq> Eq for Vector<T> where
T: Clone + Copy,
impl<T: Clone> Clone for Vector<T> where
T: Clone + Copy,
[src]
impl<T: Clone> Clone for Vector<T> where
T: Clone + Copy,
fn clone(&self) -> Vector<T>
[src]
fn clone(&self) -> Vector<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Vector<T> where
T: Clone + Copy,
[src]
impl<T: Copy> Copy for Vector<T> where
T: Clone + Copy,