Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

azimuth.sh 829 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. #!/usr/bin/env bash
  2. #
  3. # Tests mapproject for azimuth calculation
  4. # Important to use backazimuth in this example!
  5. gmt begin azimuth ps
  6. plon=186.3
  7. plat=-60.1
  8. lon=156.293957716
  9. lat=-8.06651671195
  10. # Get az from point to pole
  11. az=$(echo $lon $lat | gmt mapproject -Ab${plon}/${plat} -o2 -fg)
  12. # Add 90 to aziumth:
  13. az2=$(gmt math -Q $az 90 SUB 360 FMOD =)
  14. gmt basemap -R140/210/-65/15 -JM6i -Bafg2 -BWEsn+o${plon}/${plat}+t"Parallel az = $az2"
  15. echo ${plon} ${plat} | gmt plot -Sc0.1i -Gred
  16. echo ${lon} ${lat} | gmt plot -Sc0.1i -Ggreen
  17. cat << EOF | gmt plot -W1p
  18. ${lon} ${lat}
  19. ${lon} 15
  20. EOF
  21. cat << EOF | gmt plot -W1p,red
  22. ${lon} ${lat}
  23. ${plon} ${plat}
  24. EOF
  25. echo ${lon} ${lat} $az 1000 | gmt plot -S=0.15i+e -W1p,blue -Ggreen
  26. echo ${lon} ${lat} $az2 1000 | gmt plot -S=0.15i+e -W1p,blue -Ggreen
  27. gmt end show
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...