Re: Create circle with given radius around a point
Juan Diaz-Naveas <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <CABeNKB=-iGdcShsTdGpizB7O3Oi01ea4Y1wzQKRTEN=C2PN01A@mail.gmail.com> |
Dear Andreas, Please find attached a script that uses gawk, but no GMT to accomplish what you want. Best wishes Juan Diaz-Naveas On Wed, Feb 5, 2014 at 6:55 AM, Andreas B <[email protected]> wrote: > Hi all, > > I have an arbitrary point, either (lat/lon or x/y), that I want to draw a > circle around with a given radius (and I guess you choose a "output points > every dist units"-parameter?). I need to output this into a text file for > plotting in other programs. How can I do this? > > Best regards, > Andreas > To unsubscribe, send the message "signoff gmt-help" to > [email protected] To unsubscribe, send the message "signoff gmt-help" to [email protected]
circumference.sh
(application/x-sh, 208 B)
gawk 'BEGIN{
x0=10.0
y0=20.0
r=5.0
amin=0.0
amax=360.0
da=1.0
d2r=4.0*atan2(1.0,1.0)/180.0
for (a=amin; a<=amax; a=a+da) {
arad=a*d2r
x=x0+r*cos(arad)
y=y0+r*sin(arad)
print (x, y)}
}' > cirmcumference.xy