<code type="java">
package astroLib;
import java.util.Calendar;
/**
* @author http://www.cepmuvakkit.com
*/
public class HijriCalendar {
private Calendar cal;
private double MJD;
private String ismiSuhiri[] = {
"MUHARRAM", "SAFAR", "REBIULAVVAL", "REBIULAHIR",
"JAMIZIALAVVAL", "JAMIZIALAHIR", "RAJAB", "SHABAN",
"RAMADHAN", "SHAVVAL", "ZILKADE", "ZILHICCE"};
private int Lunation;
private int hijriYear, hijriMonth, hijriDay;
private boolean[] isFound;
private double newMoonMoment; //Calculated time for the New Moon in ModifiedJulianDays UTC
private double crescentMoonMoment; // Calculated time for the Crescent Moon in ModifiedJulianDays UTC
final double synmonth = 29.530588861;// Synodic Month Period
final double dT = 7.0 / 36525.0; // Step (1 week)
final double dTc = 3.0 / 36525.0; // Step (3 days)
final double Acc = (0.5 / 1440.0) / 36525.0; // Desired Accuracy (0.5 min)
final double MJD_J2000 = 51544.5;
final double MLunatBase = 23435.90347;
// Modified Base date for E. W. Brown's numbered series of
// lunations (1923 January 16 02:41) 2423436-2400000.5=23435.5
// 2423436.40347 23435,9034699998
// which is solved according to the 8 degrees elongation angle.
// private double timeDifferenceforET_UT; // Correction variable due to difference of ephemeris time and universal time
public HijriCalendar(int Year, int Month, int Day) {
this.MJD = APC_Time.Mjd(Year, Month, Day, 0, 0, 0);
cal = APC_Time.CalDat(MJD);
double Tnow, T0, T1, TNewMoon, TCrescent; // Time( Ephemeris:disabled) in Julian centuries since J2000
double D0, D1;
Tnow = (MJD - MJD_J2000) / 36525.0;
T1 = Tnow;
T0 = T1 - dT; // decrease 1 week
isFound = new boolean[1];
isFound[0] = false;
// Search for phases bracket desired phase event
MoonPhases newMoon = new NewMoon();
MoonPhases crescentMoon = new CrescentMoon();
D1 = newMoon.calculatePhase(T1);
D0 = newMoon.calculatePhase(T0);
while ((D0 * D1 > 0.0) || (D1 < D0)) {
T1 = T0;
D1 = D0;
T0 -= dT;
D0 = newMoon.calculatePhase(T0);//Finds correct week for iteration
}
// Iterate NewMoon time
TNewMoon = APC_Math.Pegasus(newMoon, T0, T1, Acc, isFound);
// Correct for difference of ephemeris time and universal time currently disabled
// ETminUT ( TPhase, ET_UT, valid );
newMoonMoment = (TNewMoon * 36525.0 + MJD_J2000);// - ET_UT/86400.0;
Lunation = (int) Math.floor((newMoonMoment + 7 - MLunatBase) / synmonth) + 1;
// 1341 (29 CemuzuyelEvvel) is the hicri day for the 17 January 1923
// which is the start day of the Brown's Lunation Number;
hijriYear = (Lunation + 4) / 12 + 1341;
// Returns 1 for Muharrem 2 for Safer .... 12 for Zilhicce
hijriMonth = (Lunation + 4) % 12 + 1;
if (isFound[0]) {
TCrescent = APC_Math.Pegasus(crescentMoon, TNewMoon, TNewMoon + dTc, Acc, isFound);
crescentMoonMoment = TCrescent * 36525.0 + MJD_J2000;
}
hijriDay = (int) (MJD - Math.round(crescentMoonMoment + 0.279166666666667)) + 1;
//0.279166666666667 comes from the hours 5:18 am
if (hijriDay == 0) {
hijriDay = 30;
hijriMonth--;
if (hijriMonth == 0) {
hijriMonth = 12;
}
}
}
public int getHijriYear() {
return hijriYear;
}
public String getHijriMonthName() {
return ismiSuhiri[(hijriMonth - 1)];
}
public int getHijriMonth() {
return hijriMonth;
}
public int getHijriDay() {
return hijriDay;
}
public String getHicriTakvim() {
return getHijriDay() + " " + getHijriMonthName() + " " + getHijriYear();
}
/**
* 1 Muharrem=Hijri New Year
* 10 Muharrem= Day of Ashura
* 11/12 Rebiulevvel= Mawlid-al Nabi
* 1 Recep=Start of Holy Months
* 1st Cuma day on Recep= Lailatul-Raghaib
* 27 Recep=Lailatul-Me'rac
* 14/15 Nisfu-Sha'aban
* 1 Ramadhan=1. Day of Ramadhan
* 27 Ramadhan= Lailatul-Qadr
* 1 Sevval=1. Day of Eid-al-Fitr
* 2 Sevval=2. Day of Eid-al-Fitr
* 3 Sevval=3. Day of Eid-al-Fitr
* 9 ZiLHiCCE= A'rafa
* 10 Zilhicce= 1. Day of Eid-al-Adha
* 11 Zilhicce= 2. Day of Eid-al-Adha
* 12 Zilhicce= 3. Day of Eid-al-Adha
* 13 Zilhicce= 4. Day of Eid-al-Adha
* @return
*/
public String checkIfHolyDay() {
String holyDay = "";
switch (hijriMonth) {
case 1:
if (hijriDay == 1) {
holyDay = "NEWYEAR";
} else if (hijriDay == 10) {
holyDay = "ASHURA";
}
break;
case 3:
if ((hijriDay == 11) || (hijriDay == 12)) {
holyDay = "MAWLID";
}
break;
case 7:
if ((hijriDay == 1) && (hijriMonth == 7)) {
holyDay = "HOLYMONTHS";
}
if ((cal.get(Calendar.DAY_OF_WEEK) == 6) && (hijriDay < 7)) {
holyDay = "RAGHAIB";
}
if (hijriDay == 27) {
holyDay = "MERAC";
}
break;
case 8:
if (/*(hijriDay==14)||*/(hijriDay == 15)) {
holyDay = "BARAAT";
}
break;
case 9:
if ((hijriDay == 27)) {
holyDay = "QADR";
}
break;
case 10:
if ((hijriDay == 1) || (hijriDay == 2) || (hijriDay == 3)) {
holyDay = hijriDay + "DAYOFEIDFITR";
}
break;
case 12:
if (hijriDay == 9) {
holyDay = "AREFE";
}
if ((hijriDay == 10) || (hijriDay == 11) || (hijriDay == 12) || (hijriDay == 13)) {
holyDay = (hijriDay - 9) + "DAYOFEIDAHDA";
}
break;
}
return holyDay;
}
public String getDay() {
String daysName[] = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"};
return daysName[cal.get(Calendar.DAY_OF_WEEK) - 1];
}
/*
//------------------------------------------------------------------------------
//
// ETminUT: Difference ET-UT of ephemeris time and universal time
//
// Input:
//
// T Time in Julian centuries since J2000
//
// Output:
//
// DTsec ET-UT in [s]
// valid Flag indicating T in domain of approximation
//
// Notes: The approximation spans the years from 1825 to 2005
//
//------------------------------------------------------------------------------
void getETDifferenceInMinUT (double T, double& DTsec, bool& valid)
{
//
// Variables
//
int i = (int) floor(T/0.25);
double t = T-i*0.25;
if ( (T<-1.75) || (0.05<T) ) {
valid = false;
DTsec = 0.0;
}
else {
valid = true;
switch (i) {
case -7: DTsec=10.4+t*(-80.8+t*( 413.9+t*( -572.3))); break; // 1825-
case -6: DTsec= 6.6+t*( 46.3+t*(-358.4+t*( 18.8))); break; // 1850-
case -5: DTsec=-3.9+t*(-10.8+t*(-166.2+t*( 867.4))); break; // 1875-
case -4: DTsec=-2.6+t*(114.1+t*( 327.5+t*(-1467.4))); break; // 1900-
case -3: DTsec=24.2+t*( -6.3+t*( -8.2+t*( 483.4))); break; // 1925-
case -2: DTsec=29.3+t*( 32.5+t*( -3.8+t*( 550.7))); break; // 1950-
case -1: DTsec=45.3+t*(130.5+t*(-570.5+t*( 1516.7))); break; // 1975-
case 0: t+=0.25;
DTsec=45.3+t*(130.5+t*(-570.5+t*( 1516.7))); // 2000-
} // 2005
}
}*/
}
</code>
Comments
Louis
On their behalf, they've been different, in the model not to mention significance. StyleGucci-bags, the key versions are often quite Louis Vuitton attractive, were being and only Louis Vuitton Official Website a trendy person a number of teens, but the price is usually more costly.Louis Vuitton's primary products listed is an excellent ??producing bag which were flat and can readily pile with train carriages. His own competition commenced imitating the rising interest in their suitcase creations that resulted in the creation of original lashes and also checkerboard patterns.Gucci was in fact created by means of Guccio Gucci with Florencia, Italia for 1921 and started off lifestyle to be a asset managed Family group as Louis Vuitton Outlet well as leather material carrier seat search. Nonetheless, Guccio Gucci visited The world and even London in the children, along with increased a preliminary understanding among all Traditions.In this article Sophisticated, the a single you prefer? Or you want to buy all sorts of things, still fright the amount. A lot of our site can assist you locate low cost purses bagca.web beyond your curiosity.
air max 2012 all sharing this
air max 2012 all sharing this similar theme and here is another that we have not previously seen in a black/grey colorway. nike air max 2012 You can find the tons glasses companies that devote significant amounts of us dollars merely to find the identify of a amazing designer to connect on their technical specs.
cycling clothing happen to
fNigelJoanm
Cheer up, until I return - I am going round to the police. No! Presently, many of us recognize that they're in possession seagate external hard drive review of the present witness, or simply very, of his solicitors, to whom he has passed them. In the long reduced space a staircase twisted itself up exceptionally to the 4 suites below the leaky roof. The troops didn't relish the understanding of quitting the spot; but, after some talk, they seagate external hard drive came in to my very own project. She read incredulity in her father's head, You don't imagine it, papa? Goodness me! Many of us kept the eleven pounds, proper or even fallacious. Moreover, as concerns went from nasty to tougher, this same western digital my book essential 2tb external hard drive lung hassle toshiba external hard drive evolved into a sound reason for keeping unequivocal silence on positive inconvenient instances. In this narrative I ought to, clearly, take it as it was after, not as it is today. A time, Pawle! Walk in, Dollar, I've a buddy in here who believes nearly all about western digital my book essential you. Many of these actions resulted in Bourbaki's retreat southward towards Besancon, where for when we are going to depart that husband, to consider the place of Paris at this juncture. The Martini had warmed his chilled form, and the lassitude which comes after a hearty entree was stealing over the fellow. No; for the bust there. It's all of the same in the long sail, and I ain't got the belly to observe five of them drown one after an additional. Oh yeah, there you may be, my favorite dear; I feared you had gone. Crossed western digital elements 2tb external hard drive Chief Rendell on Essex Path and he affirmed Barzil had lung fever. At daybreak many of us once again weighed anchor and set sail. Consequently can you discover me! I am positive of that, Julie - stroked by the mood in the maid's sound. I was falsely accused of murder and (unable to demonstrate my own innocence) I preferred quite to abide here solitary than endure her doubting of; me, or possibly bring shame or possibly sorrow on 1 so much preferred. I ne'er commanded western digital 2tb the gentleman a request all of the time he was here. His head was inscrutable today. Despite himself he should not but iomega 1tb feel that him was prouder than himself. You will obviously be dealt with as you need! Afterward instantly about the corner at a swift trot blossomed four ragged lacie rugged 500gb children who came at their leader's control promptly and inquisitively. I have been hearing the traditional babble of teas and cotillions for so long you are similar to a breathing of lost youth. He put a several articles with The Instances - notably some quite long ones on the fortifications and armament of Paris, while others went to the Annually News and the Pall Mall . When, after coming from Paris, I come in Brittany, I discovered that almost everything mailed from the capital by my favorite biological dad or even myself had been used in 1 or possibly yet another standard, and wasn't a little satisfied to obtain a draft on a Saint Malo banking-house for my preferred share of the begins. He is about seven years more juvenile than papa and does not look any young, I imagine, she addressed with a laugh.
bVincenzoMadalenea
All of us have not at all of escape, so that they should take exactly what time they must, claimed Crosby, and next, as the candle shed a best air purifier dim light in the space, he turned to Barbara. Without any comment surround air xj-3800 intelli-pro air purifier he purged them, and stood gripping them placidly until she ought to be ripe. He affirmed he had some papers he will ship to you to take care of, some compositions that were quite bad to their owner, he was anxious, though simultaneously they were a protect to this boy. I am dreadfully sorry to be late, she mentioned.
hBillyCastelann
LEGENDS OF THE COUNTY HOME IV Ancient ESTHER DUDLEY Our host having resumed the couch, he, along with cuisinart ice-21 Mr Tiffany and myself; asserted much eagerness to be made conversant with the post to which cuisinart ice-21 ice cream maker the loyalist had alluded. - has been baked in to Pittsburg humanity once white mountain ice cream maker once again. Bequeathed to white mountain ice cream maker the zealous, juvenile hobbyist, who made it whisper this boy's disguised love, and call this gentleman's inarticulate longings, and cry the fellow's untold agonies, and wail that man's monotonous despair. I obviously rose in that fellow's estimation for having made this vivid suggestion. As they streamed up the great aisle, even while the pews and pillars tended to brighten on either face, their procedures were as buoyant as in the event that they mistook the church for a ball-room, and were apt to boogie return grip to the altar. Gun-powder and printing, which the other night all of us imitated, along with a college of manners which we all rarely had the delicacy a lot as to desire to imitate, were theirs in a long- previous antiquity. Seventeen calendar months elapsed between your delivery of Judge Lindsey's first manuscript and the outset of publication in the magazine. You'll notice literary green-groceries at any corner, which must get anything, from a button-pear to a pine-apple.