coriolis_f <- function(lat, rad = FALSE){
checks <- makeAssertCollection()
assert_numeric(lat,lower = -90, upper = 90,add = checks)
assert_logical(rad, add = checks)
reportAssertions(checks)
if(!rad){
lat <- lat / 180 * pi
}
return(2* 7.2921e-5 *sin(lat))
}
coriolis_b <- function(lat, a = 6371000, rad = FALSE){
checks <- makeAssertCollection()
assert_numeric(lat,lower = -90, upper = 90,add = checks)
assert_logical(rad, add = checks)
assert_numeric(a, len = 1, finite = TRUE,add = checks)
reportAssertions(checks)
if(!rad){
lat <- lat / 180 * pi
}
return(2* 7.2921e-5 *cos(lat)/a)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.