Skip to content

Commit

Permalink
Add mean function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Mar 22, 2024
1 parent baf5414 commit 585c653
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ value class Latitude(val value: Float) {
private const val MAX_LATITUDE_VALUE: Float = 90f
private val LATITUDE_RANGE = MIN_LATITUDE_VALUE..MAX_LATITUDE_VALUE

fun mean(latitude1: Latitude, latitude2: Latitude): Latitude =
fromFloat((latitude1.value + latitude2.value) / 2)

/**
* Create a [Latitude] from a float value.
*
Expand Down

0 comments on commit 585c653

Please sign in to comment.