Skip to content

Commit

Permalink
Add scalar angle multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Oct 2, 2023
1 parent fee13bf commit c56bbe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ object Angle extends AngleOptics {
Angle.fromMicroarcseconds(toMicroarcseconds - a.toMicroarcseconds)

/**
* Scalar multiplication of this angle and `a`. Exact
* Scalar multiplication of this angle and and natural number `a`. Exact
* @group Operations
*/
def *(a: Long): Angle =
Angle.fromMicroarcseconds(toMicroarcseconds * a)

/**
* Scalar multiplication of this angle and `a`. approximate
* Scalar multiplication of this angle and double precission number `a`. Approximate
* @group Operations
*/
def *?(a: Double): Angle =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,6 @@ final class AngleSuite extends munit.DisciplineSuite {
assertEquals(Angle.Angle90 *? 10, Angle.Angle180)
assertEquals(Angle.Angle180 *? 0.5, Angle.Angle90)
assert(((Angle.Angle180 *? 0.001) - Angle.fromDoubleDegrees(0.18)).toMicroarcseconds < 1000)
assert(((Angle.Angle180 *? -0.001) - Angle.fromDoubleDegrees(359.82)).toMicroarcseconds < 1000)
}
}

0 comments on commit c56bbe0

Please sign in to comment.