Skip to content

Instantly share code, notes, and snippets.

@karawoo
Last active August 29, 2015 14:08
Show Gist options
  • Save karawoo/5b7b52c76b9739d7a8d6 to your computer and use it in GitHub Desktop.
Save karawoo/5b7b52c76b9739d7a8d6 to your computer and use it in GitHub Desktop.
Convert warp speed to meters/second
warp_equivalent <- function(warpfactor, originalseries = FALSE) {
if (originalseries == TRUE) {
v <- (warpfactor^3) * 299792458 # speed of light -- 299792458 m/s
} else if (originalseries == FALSE) {
if (warpfactor > 9.0 & warpfactor <= 10.0) {
x <- -0.5 * log10(10 - warpfactor)
} else {
x <- 0
}
v <- (warpfactor^((10/3) + x)) * 299792458
}
v
}
# see http://www.anycalculator.com/warpcalculator.htm for formula
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment