#!/bin/sh # antipodes_xearth -- Antipodes: Display the antipodes [farthest away points on earth] # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/ # Created On : Mon Oct 15 09:22:46 2001 # Last Modified By: # Last Modified On: Mon Jan 17 09:51:47 2011 # Update Count : 82 # Status : OK for GNU/Linux... case "$@" in --random) set -- $((RANDOM%180-90)) $((RANDOM%360-180));; *--help*|*-\?*) cat <&2 usage: $0 latitude longitude, in form 32 or 32.333 but not 32:20 More options below. Example: to see antipodes centered at Philadelphia: $0 40 -75 To make a gif: G=gif $0 40 -75; then look in /tmp... However I don't know why running through ImageMagick's convert and combine commands bloat the image file so much. >Because ImageMagick is freeware, it doesn't do LZW compression by default... >The problem with larger-than-expected GIFS is mentioned in the README.txt >that comes with ImageMagick... >You could use PNG instead and get better compression. >If you must have GIFs, then use a licensed third-party application to >recompress them. --Glenn To save the image file. copy it from /tmp before you kill xli :-) To do a transparent globe instead of antipodes, add C= like: C= $0 40 -75 $0 --random picks random locations. try while :;do $0 --random; done I ought to make better options... EOF test "x$1" = xintroed || echo $0 --help for introduction 1>&2 exit 11;} set -e #calculate coordinates of antipode: set dummy `awk "BEGIN{print $1*-1,$2+($2>0?-180:180)}"` $1 $2 T=/tmp/antipodes$$ P= #"-proj cyl" #but default orthographic projection is best XE="xearth -nostars -noshade -grid $P" : ${G=ppm} #ppm or gif, ppm much faster in "combine", but MUCH larger... trap "rm $T.[1234].$G" 0 #so copy the tmp file before you exit the #viewer, if you want it set -x #"markerfile not relevant for GIF or PPM output", oh $XE -pos "fixed $4 $5" -$G > $T.1.$G #make front side $XE -pos "fixed $2 $3" ${C--rot 180} -$G > $T.2.$G #make back side convert -flop $T.2.$G $T.3.$G #flop the back side combine -compose ReplaceGreen $T.3.$G $T.1.$G $T.4.$G #patse together #somebody tell me better colors please xli -title "${C-Antipodes} (image center: lat $4, long $5)" $T.4.$G #view it #to view several random's but not wait for computing the next one to compute: #while :;do antipodes --random;done&while :;do antipodes --random;done #but then the new one pops up before were finished looking at the old one... #hmm perhaps each time view one, create the next in the backgound but don't #view it... bla bla, etc. #埔里的對蹠點 Antipode of Puli is 5073-II on #http://www.omnimap.com/cgi-bin/omni/graphic.pl?par50w.gif #Dan's antipode is on 5072-I