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

Attachment: pgp3EUE5B5p97.pgp
Description: PGP signature

Reply via email to