Created
October 23, 2012 19:47
-
-
Save laszlokorte/3941116 to your computer and use it in GitHub Desktop.
Uni Hamburg - SE3-Übung #1 2012
This file contains 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
#lang racket | |
(define (degree->radian degree) | |
(* (/ (* 2 pi) 360) degree)) | |
(define (radian->degree radian) | |
(* (/ 360 (* pi)) radian)) | |
(define (my-acos alpha) | |
(if (= alpha 0) | |
(/ pi 2) | |
(atan (/ (sqrt (- 1 (expt alpha 2))) alpha)))) | |
(define (nm->km nm) | |
(* 1.852 nm)) | |
;not working yet | |
(define (distanzAB latA longA latB longB) | |
(nmToKm (* 60 (radianToDegree (my-acos (+ | |
(* (sin latA) (sin latB)) | |
(* (cos latA) (cos latB) (cos (- longA longB))) | |
))))) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment