R/wavelength.R

Defines functions wavelength

wavelength <- function(frequency, speed=soundSpeed(medium="air"), unit="m") {
  if (unit == "m") {
    return (speed/frequency)
  }
  if (unit == "cm") {
    return (100 * speed/frequency)
  }
  stop("Invalid unit selction: ", unit)
}

Try the sonicscrewdriver package in your browser

Any scripts or data that you put into this service are public.

sonicscrewdriver documentation built on May 29, 2024, 3:39 a.m.