merge
This commit is contained in:
parent
c6a5f5f2fb
commit
7815047329
|
@ -72,14 +72,6 @@ impl Outline {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn with_capacity(capacity: usize) -> Outline {
|
||||
Outline {
|
||||
contours: Vec::with_capacity(capacity),
|
||||
bounds: RectF::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_segments<I>(segments: I) -> Outline
|
||||
where
|
||||
|
@ -143,11 +135,6 @@ impl Outline {
|
|||
outline
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
self.contours.len()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn bounds(&self) -> RectF {
|
||||
self.bounds
|
||||
|
|
|
@ -178,29 +178,6 @@ impl Vector2F {
|
|||
pub fn to_i32(self) -> Vector2I {
|
||||
Vector2I(self.0.to_i32x2())
|
||||
}
|
||||
|
||||
/// Returns the inverse vector
|
||||
///
|
||||
/// `v · v.inv() = (1.0, 1.0)`
|
||||
#[inline]
|
||||
pub fn inv(self) -> Vector2F {
|
||||
Vector2F::new(1.0 / self.x(), 1.0 / self.y())
|
||||
}
|
||||
|
||||
/// Returns the angle of the vector
|
||||
///
|
||||
/// The angle will be in [-PI, PI]
|
||||
#[inline]
|
||||
pub fn phi(self) -> f32 {
|
||||
self.y().atan2(self.x())
|
||||
}
|
||||
|
||||
/// Compute the angle between `self` and `other`
|
||||
///
|
||||
/// The angle will be in [-PI, PI]
|
||||
pub fn angle_to(self, other: Vector2F) -> f32 {
|
||||
(self.dot(other) / (self.square_length() * other.square_length()).sqrt()).acos() * self.det(other).signum()
|
||||
}
|
||||
}
|
||||
|
||||
/// A convenience alias for `Vector2F::new()`.
|
||||
|
|
Loading…
Reference in New Issue