Skip to content

Instantly share code, notes, and snippets.

@uvtc
Created May 27, 2022 22:19
Show Gist options
  • Save uvtc/d4d633e2d202f9e7fe816b23e6156f94 to your computer and use it in GitHub Desktop.
Save uvtc/d4d633e2d202f9e7fe816b23e6156f94 to your computer and use it in GitHub Desktop.
#!/usr/bin/env janet
(def c 299792458)
(defn gamma [v]
(/ 1
(math/sqrt (- 1
(math/pow (/ v c)
2)))))
(var factor 0.1)
(var v (* factor c))
(while (< v c)
(print v (gamma v))
(set factor (+ factor 0.1))
(set v (* factor c)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment