Trait vector2math::_ [−][src]
Trait for manipulating circles
Associated Types
type Scalar: FloatingScalar
[src]
The scalar type
type Vector: FloatingVector2<Scalar = Self::Scalar>
[src]
The vector type
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
Provided methods
fn map_into<C>(self) -> C where
C: Circle,
C::Scalar: From<Self::Scalar>,
[src]
C: Circle,
C::Scalar: From<Self::Scalar>,
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]
C: Circle,
F: FnMut(Self::Scalar) -> <<C as Circle>::Vector as Vector2>::Scalar,
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]
I: IntoIterator<Item = Self::Vector>,
Check that the circle contains all points
fn contains_any<I>(self, points: I) -> bool where
I: IntoIterator<Item = Self::Vector>,
[src]
I: IntoIterator<Item = Self::Vector>,
Check that the circle contains any point
Implementations on Foreign Types
impl<S, V> Circle for (V, S) where
S: FloatingScalar,
V: FloatingVector2<Scalar = S>,
[src]
S: FloatingScalar,
V: FloatingVector2<Scalar = S>,