[−][src]Struct arcs::Vector
Your typical 2D vector.
Fields
x: f64
y: f64
Methods
impl Vector
[src]
pub fn new(x: f64, y: f64) -> Self
[src]
pub const fn new_unchecked(x: f64, y: f64) -> Self
[src]
pub fn from_r_theta(radius: f64, angle: f64) -> Self
[src]
pub const fn zero() -> Vector
[src]
pub const fn x_axis() -> Vector
[src]
pub const fn y_axis() -> Vector
[src]
pub fn length(self) -> f64
[src]
pub fn angle(self) -> f64
[src]
pub fn unit_vector(self) -> Vector
[src]
pub fn orientation(first: Vector, second: Vector, third: Vector) -> Orientation
[src]
pub fn dot(left: Vector, right: Vector) -> f64
[src]
pub fn cross(left: Vector, right: Vector) -> f64
[src]
pub fn lerp(start: Vector, end: Vector, progress: f64) -> Vector
[src]
pub fn centre_of_three_points(
first: Vector,
second: Vector,
third: Vector
) -> Option<Vector>
[src]
first: Vector,
second: Vector,
third: Vector
) -> Option<Vector>
pub fn rotated(self, angle: f64) -> Vector
[src]
Trait Implementations
impl Add<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the +
operator.
fn add(self, other: Vector) -> Vector
[src]
impl AddAssign<Vector> for Vector
[src]
fn add_assign(&mut self, other: Vector)
[src]
impl Bounded for Vector
[src]
fn bounding_box(&self) -> BoundingBox
[src]
impl Clone for Vector
[src]
impl ClosestPoint for Vector
[src]
fn closest_point(&self, _target: Vector) -> Closest
[src]
impl Copy for Vector
[src]
impl Debug for Vector
[src]
impl Div<f64> for Vector
[src]
type Output = Vector
The resulting type after applying the /
operator.
fn div(self, other: f64) -> Vector
[src]
impl DivAssign<f64> for Vector
[src]
fn div_assign(&mut self, other: f64)
[src]
impl From<Vector> for Vec2
[src]
impl FromIterator<Vector> for Closest
[src]
fn from_iter<I: IntoIterator<Item = Vector>>(iter: I) -> Closest
[src]
impl Length for Vector
[src]
fn length(&self) -> f64
[src]
Calculates the Vector
's magnitude.
let vector = Vector::new(3.0, 4.0); assert_eq!(vector.length(), 5.0);
impl Mul<Vector> for f64
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, other: Vector) -> Vector
[src]
impl Mul<Vector> for Affine
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, other: Vector) -> Vector
[src]
impl Mul<f64> for Vector
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> Vector
[src]
impl MulAssign<Affine> for Vector
[src]
fn mul_assign(&mut self, other: Affine)
[src]
impl MulAssign<f64> for Vector
[src]
fn mul_assign(&mut self, other: f64)
[src]
impl PartialEq<Vector> for Vector
[src]
impl Scale for Vector
[src]
fn scale(&mut self, factor: f64, base: Vector)
[src]
fn scaled(&self, factor: f64, base: Vector) -> Self where
Self: Sized + Clone,
[src]
Self: Sized + Clone,
impl StructuralPartialEq for Vector
[src]
impl Sub<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the -
operator.
fn sub(self, other: Vector) -> Vector
[src]
impl SubAssign<Vector> for Vector
[src]
fn sub_assign(&mut self, other: Vector)
[src]
impl Translate for Vector
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> RoundFrom<T> for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,
fn round_into(self) -> U
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,