Skip to content

Commit

Permalink
Merge pull request #1085 from hannobraun/math
Browse files Browse the repository at this point in the history
Fix `Vector::unit_v`
  • Loading branch information
hannobraun authored Sep 14, 2022
2 parents e1c1d5f + 417da29 commit 6f60add
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/fj-math/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ impl Scalar {
}

/// Compute the maximum of this and another scalar
pub fn max(self, other: Self) -> Self {
self.0.max(other.0).into()
pub fn max(self, other: impl Into<Self>) -> Self {
self.0.max(other.into().0).into()
}

/// Compute the smallest integer larger than or equal to this scalar
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-math/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl Vector<2> {

/// Construct a `Vector` that represents the v-axis
pub fn unit_v() -> Self {
Vector::from([1., 0.])
Vector::from([0., 1.])
}

/// Compute the 2D cross product with another vector
Expand Down

0 comments on commit 6f60add

Please sign in to comment.