Trait vector2math::_[][src]

pub trait _: Copy {
    type Scalar: FloatingScalar;
    type Vector: FloatingVector2<Scalar = Self::Scalar>;
    fn new(center: Self::Vector, radius: Self::Scalar) -> Self;
fn center(self) -> Self::Vector;
fn radius(self) -> Self::Scalar; fn map_into<C>(self) -> C
    where
        C: Circle,
        C::Scalar: From<Self::Scalar>
, { ... }
fn map_with<C, F>(self, f: F) -> C
    where
        C: Circle,
        F: FnMut(Self::Scalar) -> <<C as Circle>::Vector as Vector2>::Scalar
, { ... }
fn with_center(self, center: Self::Vector) -> Self { ... }
fn with_radius(self, radius: Self::Scalar) -> Self { ... }
fn diameter(self) -> Self::Scalar { ... }
fn circumference(self) -> Self::Scalar { ... }
fn area(self) -> Self::Scalar { ... }
fn translated(self, offset: Self::Vector) -> Self { ... }
fn scaled(self, scale: Self::Scalar) -> Self { ... }
fn to_square(self) -> [Self::Scalar; 4] { ... }
fn contains(self, point: Self::Vector) -> bool { ... }
fn cntains(self, point: Self::Vector) -> bool { ... }
fn contains_all<I>(self, points: I) -> bool
    where
        I: IntoIterator<Item = Self::Vector>
, { ... }
fn contains_any<I>(self, points: I) -> bool
    where
        I: IntoIterator<Item = Self::Vector>
, { ... } }

Trait for manipulating circles

Associated Types

type Scalar: FloatingScalar[src]

The scalar type

type Vector: FloatingVector2<Scalar = Self::Scalar>[src]

The vector type

Loading content...

Required methods

fn new(center: Self::Vector, radius: Self::Scalar) -> Self[src]

Create a new circle from a center coordinate and a radius

fn center(self) -> Self::Vector[src]

Get the circle's center

fn radius(self) -> Self::Scalar[src]

Get the circle's radius

Loading content...

Provided methods

fn map_into<C>(self) -> C where
    C: Circle,
    C::Scalar: From<Self::Scalar>, 
[src]

Map this circle to a circle of another type

fn map_with<C, F>(self, f: F) -> C where
    C: Circle,
    F: FnMut(Self::Scalar) -> <<C as Circle>::Vector as Vector2>::Scalar
[src]

Map this circle to a circle of another type using a function

fn with_center(self, center: Self::Vector) -> Self[src]

Transform the circle into one with a different top-left corner position

fn with_radius(self, radius: Self::Scalar) -> Self[src]

Transform the circle into one with a different size

fn diameter(self) -> Self::Scalar[src]

Get the circle's diameter

fn circumference(self) -> Self::Scalar[src]

Get the circle's circumference

fn area(self) -> Self::Scalar[src]

Get the circle's area

fn translated(self, offset: Self::Vector) -> Self[src]

Get the circle that is this one translated by some vector

fn scaled(self, scale: Self::Scalar) -> Self[src]

Get the circle that is this one with a scalar-scaled size

fn to_square(self) -> [Self::Scalar; 4][src]

Get the smallest square that this circle fits inside

fn contains(self, point: Self::Vector) -> bool[src]

Check that the circle contains the given point

fn cntains(self, point: Self::Vector) -> bool[src]

Alias for Rectangle::contains

Useful when contains is ambiguous

fn contains_all<I>(self, points: I) -> bool where
    I: IntoIterator<Item = Self::Vector>, 
[src]

Check that the circle contains all points

fn contains_any<I>(self, points: I) -> bool where
    I: IntoIterator<Item = Self::Vector>, 
[src]

Check that the circle contains any point

Loading content...

Implementations on Foreign Types

impl<S, V> Circle for (V, S) where
    S: FloatingScalar,
    V: FloatingVector2<Scalar = S>, 
[src]

type Scalar = S

type Vector = V

Loading content...

Implementors

Loading content...