gam(seq(from=0,by=0.1,len=10))
gam(r3vel(6,0.7))
x <- as.3vel(c(0.1,0.4,0.5))
speed(x)
gam(speed(x))  # works, but slow and inaccurate
gam(x)         # recommended: avoids needless coercion
## Use SI units and deal with terrestrial speeds.  Use gamm1() for this.
sol(299792458)
sound <- 343 # speed of sound in SI
gam(sound)
gam(sound)-1  
gamm1(sound)   # gamm1() gives much higher precision
snail <- as.3vel(c(0.00275,0,0)) # even the world's fastest snail...
gamm1(snail)                     # ...has only a small relativistic correction
## For the ultrarelativistic case of speeds very close to the speed of
## light, use gam_ur():
sol(1)           # revert to relativistic units
gam(0.99) - gam_ur(0.01) # zero to numerical accuracy
omgp <- 4.9e-24  # speed deficit of the Oh-My-God particle
gam(1-omgp)      # numeric overflow
gam_ur(omgp)     # large but finite
Run the code above in your browser using DataLab