Trait point_like::PointLike

source ·
pub trait PointLike<N: Float>: Copy + PartialEq + FromInto<[N; 2]> {
    // Required methods
    fn x(&self) -> N;
    fn y(&self) -> N;
    fn with_x(&self, x: N) -> Self;
    fn with_y(&self, y: N) -> Self;
    fn with_xy(x: N, y: N) -> Self;
}
Expand description

A point-like type that can be used to define a coordinate in 2D space.

Required Methods§

source

fn x(&self) -> N

source

fn y(&self) -> N

source

fn with_x(&self, x: N) -> Self

source

fn with_y(&self, y: N) -> Self

source

fn with_xy(x: N, y: N) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<F: Float> PointLike<F> for [F; 2]

source§

fn x(&self) -> F

source§

fn y(&self) -> F

source§

fn with_x(&self, x: F) -> Self

source§

fn with_y(&self, y: F) -> Self

source§

fn with_xy(x: F, y: F) -> Self

source§

impl<F: Float> PointLike<F> for (F, F)

source§

fn x(&self) -> F

source§

fn y(&self) -> F

source§

fn with_x(&self, x: F) -> Self

source§

fn with_y(&self, y: F) -> Self

source§

fn with_xy(x: F, y: F) -> Self

source§

impl<F: Float> PointLike<F> for (F, F, F)

source§

fn x(&self) -> F

source§

fn y(&self) -> F

source§

fn with_x(&self, x: F) -> Self

source§

fn with_y(&self, y: F) -> Self

source§

fn with_xy(x: F, y: F) -> Self

Implementors§