[−][src]Struct rustbatch::math::circle::Circ
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: Vect
r: 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]
&self,
arg: f32,
formula: fn(_: &Self, _: f32) -> (f32, f32)
) -> [Option<f32>; 2]
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]
fn intersects(&self, o: &Circ) -> bool
[src]
impl Intersection<Circ> for Ray
[src]
fn intersects(&self, o: &Circ) -> bool
[src]
impl Intersection<Ray> for Circ
[src]
fn intersects(&self, o: &Ray) -> bool
[src]
impl Intersection<Rect> for Circ
[src]
fn intersects(&self, o: &Rect) -> bool
[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]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,