Bug#415341: octave-forge: azimuth.m gives incorrect values

2007-03-18 Thread Tom Wright
Package: octave-forge
Version: 2006.07.09+dfsg1-8
Severity: normal
Tags: patch

*** Please type your report below this line ***
The calculation in mapping/azimuth.m in both the 2.1 and 2.9 branches of 
octave-forge gives incorrect values.  A correct version of the 
calculation is given at http://williams.best.vwh.net/avform.htm#Crs

Instead of the current calculation:
<   az = rad2deg(acot((sin(a) * cot(b) - cos(a) * cos(C)) / \
< sin(C)));

the calculation should be:
>   az=rad2deg(mod(atan2(sin(C)*sin(b), \
>sin(a)*cos(b)-cos(a)*sin(b)*cos(C)),\
>  2*pi));

If azimuth.m is actually doing the right thing, then perhaps its 
documentation needs changing - as I read it, it calculates the angle of 
the great circle between the two points.  This is not what the current 
calculation does.

Apologies if I've got anything wrong - I'm fairly new to spherical 
geometry - do email to discuss this if necessary.


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.061206.1
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages octave-forge depends on:
ii  octave2.1-forge   2006.03.17+dfsg1-3 Contributed functions from the 
GNU

octave-forge recommends no packages.

-- no debconf information


pgp3EUE5B5p97.pgp
Description: PGP signature


Bug#415341: octave-forge: azimuth.m gives incorrect values

2007-03-18 Thread Rafael Laboissiere
package octave-forge
tags 415341 upstream
thanks

* Tom Wright <[EMAIL PROTECTED]> [2007-03-18 15:56]:

> The calculation in mapping/azimuth.m in both the 2.1 and 2.9 branches of 
> octave-forge gives incorrect values.  A correct version of the 
> calculation is given at http://williams.best.vwh.net/avform.htm#Crs
> 
> Instead of the current calculation:
> <   az = rad2deg(acot((sin(a) * cot(b) - cos(a) * cos(C)) / \
> < sin(C)));
> 
> the calculation should be:
> >   az=rad2deg(mod(atan2(sin(C)*sin(b), \
> >sin(a)*cos(b)-cos(a)*sin(b)*cos(C)),\
> >  2*pi));
> 

There is a new version of azimut.m in the CVS repository of octave-forge [1].
Could you please check if that version does the correct calculation?

[1] 
http://octave.cvs.sourceforge.net/octave/octave-forge/extra/mapping/inst/azimuth.m?revision=1.2

-- 
Rafael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]