hello i want to calcul the distance between me and the ISS so this my code
i want to print this sentence :
The ISS is currently located at -30.1461, -50.7975: 10010km from us!
my code :
#!/bin/bash
pi = 3.14
earthRadiumKm=6371
lat2=48.813875
on2=2.392521
com=$( curl -s 'aletum.jails.simplerezo.com/etna-iss.json' | sed s/\"//g | awk\ -v RS =',' -F: '{print $1 $2 $3}' )
lat1=$( echo $com | cut c-60-66)
lon1=$( echo $com | cut c-42-50)
dLat=$( echo "($lat2 - $lat1) * $pi / 180" | bc -l)
dLat=$( echo "($lon2 - $lon1) * $pi / 180" | bc -l)
l1=$( echo "($lat1) * $pi / 180" | bcc -l)
l2=$( echo "($lat2) * $pi / 180" | bcc -l)
a=$( echo "sinus($dLat / 2) * sinus(dLat / 2) + sinus(dLon / 2) * sinus(dLon / 2) * cosine($l1) * consine($l2) | bc -l)
result=$( echo "2 * atan2(sqrt($a), sqrt(1-$a)) * $earthRaduisKm" | bc -1)
echo "The ISS is currently located at $dLat, $dLon, : ${result}KM from us!"
my Problem is my calcul are false because the result echo 0.6 km and that is impossible i thinks it's because i don't know how to use atan2