Muslim Qibla Compass
						WH_Qibla AddIn 
						By Waleed Hasan
================================================================

IntroductionL:
--------------
This REX AddIn calculates the direction of Muslim Qibla 
(direction to Makkah)


Installation:
-------------
-Upload WHqibla.rex (the AddIn) & CityTable.rex (memo file)
-Edit the CityTable memo for your home city (see below)


Usage:
------
The REX has a city table used in the World clock but
it contains only degrees - no minutes - so I had to
use a separate memo file for that.

*The city table format:
-CityName,LongDeg,LongMin,LatDeg,LatMin,GMT,DTS,HeightAboveSeaLevel
-East & South are negatives
-Home city is preceded with an '@'

*Example:
City : Alexandria (Egypt)
Longitude : 29:55 East
Latitude : 31:13 North
GMT : +2
DayTimeSaving : No
Height above sea-level : 0
The line in the city table would be like this:
Alexandris,-29,-55,31,13,2,0,0

*Changing the home city:
The program will scan the city table for a line precededed with '@'
To do that I simply open the CityTable memo file & modify it.
I mark the '@' & using EDIT->CUT then move to the new city then
EDIT->PASTE and save the file.

I wanted to  have an easier way to select the home city but no room
to do anything!


Error codes:
------------
-Err:301 : DB error, no memos???	 => ???
-Err:401 : DB error,Can't open Line DB!? => ???
-Err:501 : Can't open City Table.        => Upload the citytable.rex
-Err:502 : No home city found.	     	 => Mark a city with '@'


Bugs - They are every where!
----------------------------
I've tried my best to make this program correct.
The error is about 1 minuite (+ or -) which is quite acceptable.
Please send any comments to me wh_hsn at hotmail dot com.

Some weird things sometimes happen while compilation:
-Compiling the same program sometimes gives bad code - just
 re-compile (no need to change any lines!) & it'll work!
 This is a bug in the linker I think!
 Many times I compiled & upload the code & got error "501"
 {can't open city table} all I do is to re-compile the same
 code and upload it again & the addin runs perfectly!?!?
-Also sometimes the compilar asked me for missing ORG! - 
 just  & re-compile & it'll work!


History:
--------
23Nov2001 : The idea.
24Nov2001 : Using transdental funcions from the web.
06Dec2001 : Finally got everything working including memo
	    routines from cMemo by Chris Harris.
30Jan2002 : I corrected the original math routines in sccZ80
	    & used them instead of my own math implementations.
	    That reduced code size & I managed to draw the 
	    compass & the Kaaba icon :)
12Feb2002 : Published to the REX community.


ToDo:
-----
-If we can put the memo routines in a separate library addin
 we can handle the city table more easily.


Acknowledgment:
---------------
-Goes to everyone in the REX developers group, specialy Myles,
 Chris Haris (for the Memo handling routines), Dom & Dan for the 
 great compilar & library.


Referecnces:
------------
-The equation to calculate the Qibla is deducted from the paper:
 "The Correct Qibla" by S. Kamal Abdali, (Last Revised 1997/9/17)

    Source: geocities.com/wh_hsn/download

               ( geocities.com/wh_hsn)