[][src]Struct rustbatch::math::circle::Circ

pub struct Circ {
    pub c: Vect,
    pub r: f32,
}

Circ is what we in geometry call circle. Circle is mainly for collision detection and supports collisions with Ray, Rect and it self. There are also projection methods available.

Fields

c: Vectr: f32

Implementations

impl Circ[src]

pub fn new(x: f32, y: f32, r: f32) -> Self[src]

pub fn contains(&self, pos: Vect) -> bool[src]

returns whether point ic in circle

pub fn prj_x(&self, x: f32) -> f32[src]

projects x coordinate to y coordinate that belongs to circle or nan if there is no such y. mind that even if there are 2 possible solution for one x. If you need both solutions use precise_prf_x witch is slower but takes second solution to account.

pub fn prj_y(&self, y: f32) -> f32[src]

opposite of prj_x

pub fn formula_x(&self, x: f32) -> (f32, f32)[src]

used for other calculations

pub fn formula_y(&self, y: f32) -> (f32, f32)[src]

used for other calculations

pub fn precise_prj(
    &self,
    arg: f32,
    formula: fn(_: &Self, _: f32) -> (f32, f32)
) -> [Option<f32>; 2]
[src]

used for other calculations

pub fn precise_prj_x(&self, x: f32) -> [Option<f32>; 2][src]

projects x coordinate to zero one or two solutions. This method is considerably slower then prj_x

pub fn precise_prj_y(&self, y: f32) -> [Option<f32>; 2][src]

opposite of precise_prj_x

Trait Implementations

impl Clone for Circ[src]

impl Copy for Circ[src]

impl Debug for Circ[src]

impl Intersection<Circ> for Rect[src]

fn intersects(&self, o: &Circ) -> bool[src]

returns whether rectangle intersects circle

impl Intersection<Circ> for Circ[src]

impl Intersection<Circ> for Ray[src]

impl Intersection<Ray> for Circ[src]

impl Intersection<Rect> for Circ[src]

impl IntersectionPoints<Circ> for Ray[src]

impl IntersectionPoints<Ray> for Circ[src]

Auto Trait Implementations

impl RefUnwindSafe for Circ

impl Send for Circ

impl Sync for Circ

impl Unpin for Circ

impl UnwindSafe for Circ

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,