comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Distance between coordinates
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Distance between coordinates [message #90954 is a reply to message #90952] Mon, 18 May 2015 14:48 Go to previous messageGo to previous message
astr74323 is currently offline  astr74323
Messages: 4
Registered: May 2015
Junior Member
بتاريخ الاثنين، 18 مايو، 2015 10:51:16 م UTC+3، كتب wlandsman:
> On Monday, May 18, 2015 at 2:49:42 PM UTC-4, astr...@gmail.com wrote:
>
>> Hello Wlandsman,
>>
>> Colud you give me your email or Skype?
>>
>> Beacuse I've many quetions
>>
>> I look forward to hearing from you
>
> Sorry, I can't help you, except to point you to a document on how to ask questions on Usenet
>
> http://www.catb.org/esr/faqs/smart-questions.html



Ok, I have questions with regard to terms in gcirc.pro, Could you write comment at each command line if you can

On_error,2 ;Return to caller

npar = N_params()
IF (npar ne 6) and (npar ne 5) THEN BEGIN
print,'Calling sequence: GCIRC,U,RA1,DC1,RA2,DC2[,DIS]'
print,' U = 0 ==> Everything in radians'
print, $
' U = 1 ==> RAx decimal hours, DCx decimal degrees, DIS arc sec'
print,' U = 2 ==> RAx, DCx decimal degrees, DIS arc sec'
RETURN
ENDIF


d2r = !DPI/180.0d0
as2r = !DPI/648000.0d0
h2r = !DPI/12.0d0

; Convert input to double precision radians
CASE u OF
0: BEGIN
rarad1 = double(ra1)
rarad2 = double(ra2)
dcrad1 = double(dc1)
dcrad2 = double(dc2)
END
1: BEGIN
rarad1 = ra1*h2r
rarad2 = ra2*h2r
dcrad1 = dc1*d2r
dcrad2 = dc2*d2r
END
2: BEGIN
rarad1 = ra1*d2r
rarad2 = ra2*d2r
dcrad1 = dc1*d2r
dcrad2 = dc2*d2r
END
ELSE: MESSAGE, $
'U must be 0 (radians), 1 ( hours, degrees) or 2 (degrees)'
ENDCASE

deldec2 = (dcrad2-dcrad1)/2.0d
delra2 = (rarad2-rarad1)/2.0d
sindis = sqrt( sin(deldec2)*sin(deldec2) + $
cos(dcrad1)*cos(dcrad2)*sin(delra2)*sin(delra2) )
dis = 2.0d*asin(sindis)

IF (u ne 0) THEN dis = dis/as2r

IF (npar eq 5) && (N_elements(dis) EQ 1) THEN BEGIN
IF (u ne 0) && (dis ge 0.1) && (dis le 1000) $
THEN fmt = '(F10.4)' $
ELSE fmt = '(E15.8)'
IF (u ne 0) THEN units = ' arcsec' ELSE units = ' radians'
print,'Angular separation is ' + string(dis,format=fmt) + units
ENDIF

RETURN
END

Regards
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to ignore NaNs in the data array with function cgPercentile.pro or Percentile.pro?
Next Topic: Illegal operand error with window,/free

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:49:50 PDT 2025

Total time taken to generate the page: 0.00425 seconds