[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libitl-0.6.4 :A possible BUG? C# porting almost complete!



On Wednesday 29 March 2006 12:09, Tarik FDIL wrote:
> Salam,

Wa alaikum asalam wa rahmatullaah wabarakatuh.


> I'm not the author of this program too, but I confirm that there is a bug in 
> the expression :
> 
> #define DEG_TO_RAD(A) (A * (PI/180.0))
> 
> It should be 
> 
> #define DEG_TO_RAD(A) ((A) * (PI/180.0))

I think it should be worth looking at the early implementations of hijri
converters and prayer time calculators. The first attempt, as many know,
was made by Waleed Muhana (some have used his work in the past without
giving him credit - what a shame!). In 2000, Muhammad Hussain Yusuf
worked on Waleed's implementation, and his work is available in:

http://sourceforge.net/projects/hdate/

An equivalent to DEG_TO_RAD was a function found in praytime.c:

double deg2rad(degree)
double  degree;
{
    return(degree*RPD);
}

(You can tell from the declaration of degree that the style is pretty old)

And RPD is:

#define RPD     (0.01745329251994329577) /* radians per degree (pi/180) */


Wishing you and your family peace and good health.


Salam,
Abdalla Alothman