Struct rust_sc2::geometry::Point2 [−][src]
Expand description
Point on 2D grid, the most frequently used geometric primitive.
Fields
x: f32
y: f32
Implementations
impl Point2
[src]
impl Point2
[src]pub fn towards(self, other: Self, offset: f32) -> Self
[src]
pub fn towards(self, other: Self, offset: f32) -> Self
[src]Returns new point with offset towards other
on given distance.
pub fn towards_angle(self, angle: f32, offset: f32) -> Self
[src]
pub fn towards_angle(self, angle: f32, offset: f32) -> Self
[src]Returns new point with offset towards given angle on given distance.
pub fn circle_intersection(self, other: Self, radius: f32) -> Option<[Self; 2]>
[src]
pub fn circle_intersection(self, other: Self, radius: f32) -> Option<[Self; 2]>
[src]Returns points where circles with centers self
and other
,
and given radius intersect, or None
if they aren’t intersect.
pub fn len_squared(self) -> f32
[src]
pub fn len_squared(self) -> f32
[src]Returns squared length of the vector.
pub fn neighbors4(self) -> [Self; 4]
[src]
pub fn neighbors4(self) -> [Self; 4]
[src]Returns 4 closest neighbors of point.
pub fn neighbors4diagonal(self) -> [Self; 4]
[src]
pub fn neighbors4diagonal(self) -> [Self; 4]
[src]Returns 4 closest diagonal neighbors of point.
pub fn neighbors8(self) -> [Self; 8]
[src]
pub fn neighbors8(self) -> [Self; 8]
[src]Returns 8 closest neighbors of point.
Trait Implementations
impl AddAssign<Point2> for Point2
[src]
impl AddAssign<Point2> for Point2
[src]fn add_assign(&mut self, other: Self)
[src]
fn add_assign(&mut self, other: Self)
[src]Performs the +=
operation. Read more
impl AddAssign<f32> for Point2
[src]
impl AddAssign<f32> for Point2
[src]fn add_assign(&mut self, other: f32)
[src]
fn add_assign(&mut self, other: f32)
[src]Performs the +=
operation. Read more
impl DivAssign<Point2> for Point2
[src]
impl DivAssign<Point2> for Point2
[src]fn div_assign(&mut self, other: Self)
[src]
fn div_assign(&mut self, other: Self)
[src]Performs the /=
operation. Read more
impl DivAssign<f32> for Point2
[src]
impl DivAssign<f32> for Point2
[src]fn div_assign(&mut self, other: f32)
[src]
fn div_assign(&mut self, other: f32)
[src]Performs the /=
operation. Read more
impl MulAssign<Point2> for Point2
[src]
impl MulAssign<Point2> for Point2
[src]fn mul_assign(&mut self, other: Self)
[src]
fn mul_assign(&mut self, other: Self)
[src]Performs the *=
operation. Read more
impl MulAssign<f32> for Point2
[src]
impl MulAssign<f32> for Point2
[src]fn mul_assign(&mut self, other: f32)
[src]
fn mul_assign(&mut self, other: f32)
[src]Performs the *=
operation. Read more
impl SubAssign<Point2> for Point2
[src]
impl SubAssign<Point2> for Point2
[src]fn sub_assign(&mut self, other: Self)
[src]
fn sub_assign(&mut self, other: Self)
[src]Performs the -=
operation. Read more
impl SubAssign<f32> for Point2
[src]
impl SubAssign<f32> for Point2
[src]fn sub_assign(&mut self, other: f32)
[src]
fn sub_assign(&mut self, other: f32)
[src]Performs the -=
operation. Read more
impl Copy for Point2
[src]
impl Eq for Point2
[src]
Auto Trait Implementations
impl RefUnwindSafe for Point2
impl Send for Point2
impl Sync for Point2
impl Unpin for Point2
impl UnwindSafe for Point2
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Distance for T where
T: Into<Point2>,
[src]
impl<T> Distance for T where
T: Into<Point2>,
[src]fn distance_squared<P: Into<Point2>>(self, other: P) -> f32
[src]
fn distance_squared<P: Into<Point2>>(self, other: P) -> f32
[src]Calculates squared euclidean distance from self
to other
.
fn distance<P: Into<Point2>>(self, other: P) -> f32
[src]
fn distance<P: Into<Point2>>(self, other: P) -> f32
[src]Calculates euclidean distance from self
to other
.
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,