mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Add Vec2::dot
This commit is contained in:
@@ -253,6 +253,12 @@ impl Vec2 {
|
|||||||
vec2(self.x.max(other.x), self.y.max(other.y))
|
vec2(self.x.max(other.x), self.y.max(other.y))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The dot-product of two vectors.
|
||||||
|
#[inline]
|
||||||
|
pub fn dot(self, other: Self) -> f32 {
|
||||||
|
self.x * other.x + self.y * other.y
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the minimum of `self.x` and `self.y`.
|
/// Returns the minimum of `self.x` and `self.y`.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
|||||||
Reference in New Issue
Block a user