[−][src]Struct kurbo::Point
A 2d point.
Fields
x: f64
The x coordinate.
y: f64
The y coordinate.
Methods
impl Point
[src]
pub const ZERO: Point
[src]
The point (0, 0).
pub const ORIGIN: Point
[src]
The point at the origin; (0, 0).
pub const fn new(x: f64, y: f64) -> Self
[src]
Create a new Point
with the provided x
and y
coordinates.
pub const fn to_vec2(self) -> Vec2
[src]
Convert this point into a Vec2
.
pub fn lerp(self, other: Point, t: f64) -> Point
[src]
Linearly interpolate between two points.
pub fn midpoint(self, other: Point) -> Point
[src]
Determine the midpoint of two points.
pub fn distance(self, other: Point) -> f64
[src]
Euclidean distance.
pub fn round(self) -> Point
[src]
A new Point
, with each of x and y rounded to the nearest integer value.
Trait Implementations
impl Add<Vec2> for Point
[src]
type Output = Point
The resulting type after applying the +
operator.
fn add(self, other: Vec2) -> Self
[src]
impl AddAssign<Vec2> for Point
[src]
fn add_assign(&mut self, other: Vec2)
[src]
impl Clone for Point
[src]
fn clone(&self) -> Point
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Point
[src]
impl Debug for Point
[src]
impl Default for Point
[src]
impl Display for Point
[src]
impl From<(f64, f64)> for Point
[src]
impl From<Point> for (f64, f64)
[src]
impl Mul<Point> for Affine
[src]
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, other: Point) -> Point
[src]
impl Mul<Point> for TranslateScale
[src]
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, other: Point) -> Point
[src]
impl PartialEq<Point> for Point
[src]
impl StructuralPartialEq for Point
[src]
impl Sub<Point> for Point
[src]
type Output = Vec2
The resulting type after applying the -
operator.
fn sub(self, other: Point) -> Vec2
[src]
impl Sub<Vec2> for Point
[src]
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, other: Vec2) -> Self
[src]
impl SubAssign<Vec2> for Point
[src]
fn sub_assign(&mut self, other: Vec2)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,