Created
April 16, 2013 22:02
-
-
Save Nectarineimp/5400030 to your computer and use it in GitHub Desktop.
experiments in trigonometry in Clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn get-slope [[x1 y1] [x2 y2]] | |
| (/ (- x2 x1) (- y2 y1))) | |
| (get-slope [500 400][290 600]) | |
| (defn angle-offset [slope] | |
| (java.lang.Math/atan slope)) | |
| (angle-offset (get-slope [500 400][300 490])) | |
| (java.lang.Math/sin (angle-offset -0.45)) | |
| (/ java.lang.Math/PI 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment