## Sunday, December 1, 2013

### Myanmar Astrological Calendar Days

A typical Myanmar calendar usually describes astrological days such as auspicious days and ill fated days. In this post, we will present about the following days and javascript code for them.

The details about these days can be found at the following links.
Free Thinker
IT Mg Mg

### Sabbath and Sabbath Eve

In the Myanmar calendar, full moon days, new moon days and waxing and waning 8 are sabbath days. The day before sabbath day is sabbath eve. Javascript code to check them is shown below.
//Sabbath and Sabbath eve
//input: ( md= day of month 0-30, mml= length of month)
//output: (sabbath [sabbath:1, else: 0], sabbatheve [sabbath eve:1, else: 0])
sabbath=0; if((md==8)||(md==15)||(md==23)||(md==mml)) sabbath=1;
sabbatheve=0;if((md==7)||(md==14)||(md==22)||(md==(mml-1))) sabbatheve=1;


### Yatyaza

Yatyaza is auspicious day. Yatyaza depends on month and weekday as shown in the following table.

Yatyaza
Month Day
Kason, Tawthalin, PyathoThursday, Saturday
Nayon, Thidingyut, TabodweTuesday, Thursday
Waso, Tazaungmon, TabaungSunday, Wednesday

//Yatyaza
//input: (mm= month, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (yatyaza [yatyaza:1, else: 0])
yatyaza=0; m1=mm%4; wd1=Math.floor(m1/2)+4;
wd2=((1-Math.floor(m1/2))+m1%2)*(1+2*(m1%2));
if((wd==wd1)||(wd==wd2)) yatyaza=1;


Pyathada is ill-fated day. Pyathada depends on month and weekday as shown in the following table.

MonthDay
Kason, Tawthalin, PyathoWednesday, Friday
Nayon, Thidingyut, TabodweSunday, Monday
Waso, Tazaungmon, TabaungTuesday, Wednesday Afternoon

//Pyathada
//input: (mm= month, wd= weekday [0:sat, 1:sun, ..., 6:fri])
m1=mm%4;


### Thamanyo

Thamanyo is day of losing. Thamanyo depends on month and weekday as shown in the following table.

Thamanyo
Monthweekday
TaguSaturday, Sunday
KasonMonday, Tuesday
NayonWednesday, Thursday
WasoFriday, Saturday
WagaungSunday, Monday
TawthalinTuesday, Wednesday
ThidingyutThursday, Friday
TazaungmonSaturday, Sunday
PyathoSunday, Monday
TabodweTuesday, Wednesday afternoon
TabaungThursday, Friday

//Thamanyo
//input: (mm= month [1:Tagu, ... , 12:Tabaung], wd= weekday [0:sat, 1:sun, ... , 6:fri])
//output: (thamanyo [Thamanyo:1, else: 0])
thamanyo=0; m1=mm-1-Math.floor(mm/9); wd1=(m1*2-Math.floor(m1/8))%7;
wd2=(wd+7-wd1)%7; if(wd2<=1) thamanyo=1;


### Amyeittasote

Amyeittasote is good and fulfilling day. Amyeittasote depends on waxing or waning day and weekday as shown in the following table.

Amyeittasote
waxing or waning dayweekday
1Friday
2Wednesday
3Monday
4Thursday
5Saturday
7Tuesday
8Sunday

//Amyeittasote
//input: (d=waxing or waning day, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (amyeittasote [Amyeittasote:1, else: 0])
amyeittasote=0; wda=[5,8,3,7,2,4,1]; if(d==wda[wd]) amyeittasote=1;


### Warameittugyi

Warameittugyi is bad and hindered day. Warameittugyi depends on waxing or waning day and weekday as shown in the following table.

Warameittugyi
waxing or waning dayweekday
7Saturday
1Sunday
4Monday
8Tuesday
9Wednesday
6Thursday
3Friday

//Warameittugyi
//input: (d=waxing or waning day, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (warameittugyi [warameittugyi:1, else: 0])
warameittugyi=0; wda=[7,1,4,8,9,6,3]; if(d==wda[wd]) warameittugyi=1;


### Warameittunge

Warameittunge is bad and hindered day. Warameittunge depends on waxing or waning day and weekday as shown in the following table.

Warameittunge
waxing or waning dayweekday
6Saturday
12Sunday
11Monday
10Tuesday
9Wednesday
8Thursday
7Friday

//Warameittunge
//input: (d=waxing or waning day, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (warameittunge [warameittunge:1, else: 0])
warameittunge=0; wn=(wd+6)%7; if((12-d)==wn) warameittunge=1;


### Yatpote

Yatpote is withered and faded day. Yatpote depends on waxing or waning day and weekday as shown in the following table.

Yatpote
waxing or waning dayweekday
8Saturday
1Sunday
4Monday
6Tuesday
9Wednesday
8Thursday
7Friday

//Yatpote
//input: (d=waxing or waning day, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (yatpote [yatpote:1, else: 0])
yatpote=0; wda=[8,1,4,6,9,8,7]; if(d==wda[wd]) yatpote=1;


### Thamaphyu

Thamaphyu is day of losing. Thamaphyu depends on waxing or waning day and weekday as shown in the following table.

Thamaphyu
waxing or waning dayweekday
1Saturday, Sunday
2Sunday
3Thursday, Friday
4Thursday
5Wednesday
6Monday, Tuesday, Thursday
7Friday
11Monday

//Thamaphyu
//input: (d=waxing or waning day, wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (thamaphyu [thamaphyu:1, else: 0])
thamaphyu=0; wda=[1,2,6,6,5,6,7];  if(d==wda[wd]) thamaphyu=1;
wda=[0,1,0,0,0,3,3]; if(d==wda[wd]) thamaphyu=1;
if((d==4) && (wd==5)) thamaphyu=1;


### Nagapor

Nagapor is dissatisfying day. Nagapor depends on waxing or waning day and weekday as shown in the following table.

Nagapor
WeekdayWaxing moon dayWaning moon day
Saturday   2, 11
Sunday24, 6
Monday1, 2, 4, 12 3
Tuesday10
Wednesday93
Thursday2
Friday  6

//Nagapor
//input: (md=day [0-30], wd= weekday [0:sat, 1:sun, ..., 6:fri])
//output: (nagapor [Nagapor:1, else: 0])
nagapor=0; wda=[26,21,2,10,18,2,21];  if(md==wda[wd]) nagapor=1;
wda=[17,19,1,0,9,0,0]; if(md==wda[wd]) nagapor=1;
if(((md==2) && (wd==1)) ||(((md==12)||(md==4)||(md==18)) && (wd==2)))nagapor=1;


### Yatyotema

Yatyotema is withered and faded day. Yatyotema depends on month and waxing or waning day as shown in the following table.

Yatyotema
Monthwaxing or waning day
Tagu, Waso6
Kason, Tabodwe4
Nayon, Tawthalin8
Wagaung, Tazaungmon10
Thidingyut, Pyatho12

//Yatyotema
//input: (mm= month [1:Tagu, ... , 12:Tabaung], d=waxing or waning day [1 - 15])
//output: (yatyotema [yatyotema:1, else: 0])
yatyotema=0; m1=(mm%2)?mm:((mm+9)%12); m1=(m1+4)%12+1; if(d==m1) yatyotema=1;


### Mahayatkyan

It is said that Mahayatkyan should be avoided. Mahayatkyan depends on month and waxing or waning day as shown in the following table.

Mahayatkyan
Monthwaxing or waning day
Tagu5
Kason, Nayon6
Waso, Wagaung1
Tawthalin, Thidingyut2
Pyatho, Tabodwe4
Tabaung5

//Mahayatkyan
//input: (mm= month [1:Tagu, ... , 12:Tabaung], d=waxing or waning day [1 - 15])
//output: (mahayatkyan [Mahayatkyan:1, else: 0])
mahayatkyan=0; m1=(Math.floor((mm%12)/2)+4)%6+1; if(d==m1) mahayatkyan=1;


### Shanyat

It is said that Shanyat should be avoided. Shanyat depends on month and waxing or waning day as shown in the following table.

Shanyat
Monthwaxing or waning day
Tagu, Kason8
Nayon, Waso2
Wagaung9
Tawthalin, Thidingyut3
Tazaungmon5
Pyatho, Tabaung4
Tabodwe7

//Shanyat
//input: (mm= month [1:Tagu, ... , 12:Tabaung], d=waxing or waning day [1 - 15])
//output: (shanyat [Shanyat:1, else: 0])
shanyat=0; sya=[8,8,2,2,9,3,3,5,1,4,7,4]; if(d==sya[mm-1]) shanyat=1;


### Nagahle

The direction of the Milky Way galaxy is called Nagahle.

Nagahle
MonthDirection
Tabaung, Tagu, KasonWest
Nayon, Waso, WagaungNorth
Tawthalin, Thidingyut, TazaungmonEast

//Nagahle
//input: (mm= month [1:Tagu, ... , 12:Tabaung])
//output: (nagahle [0: west, 1: north, 2: east, 3: south])
nagahle=Math.floor((mm%12)/3);


### Mahabote

Mahabote has 7 types called Puti, Binga, Marana, Atun, Thike, Yaza, and Adipati [မဟာဘုတ်-ဝီကီပီးဒီးယား].
//Mahabote
//input: (my= myanmar year, wd= weekday [0=sat, 1=sun, ..., 6=fri])
//output: (mahabote [0=Binga, 1=Atun, 2=Yaza, 3=Adipati, 4= Marana, 5=Thike, 6=Puti])
mahabote=(my-wd)%7;


### Nakhat

Nakhat is obtained by dividing Myanmar year by 3 as follow.
//Mahabote
//input: (my= myanmar year)
//output: (nakhat [0=orc, 1=elf, 2=human])
nakhat=my%3;


### Summary

The javascript code for calculating the above astrological days are summarized as shown in the following function.
//Checking Astrological days
//input: (mm=month, mml= length of the month,md= day of the month [0-30],
// wd= weekday  [0=sat, 1=sun, ..., 6=fri], my=Myanmar year)
// warameittugyi,warameittunge,yatpote,thamaphyu,nagapor,yatyotema,
// mahayatkyan,shanyat,nagahle [0=west, 1=north, 2=east, 3=south],
//  mahabote [0=Binga, 1=Atun, 2=Yaza, 3=Adipati, 4= Marana, 5=Thike, 6=Puti]
// nakhat [0=orc, 1=elf, 2=human])
// More details @ http://cool-emerald.blogspot.sg/2013/12/myanmar-astrological-calendar-days.html
function astro(mm,mml,md,wd,my) {
var warameittugyi,warameittunge,yatpote,thamaphyu,nagapor,yatyotema;
var mahayatkyan,shanyat,nagahle,m1,wd1,wd2,wda,sya,mahabote;
if (mm<=0) mm=4;//first waso is considered waso
d=md-15*Math.floor(md/16);//waxing or waning day [0-15]
sabbath=0; if((md==8)||(md==15)||(md==23)||(md==mml)) sabbath=1;
sabbatheve=0;if((md==7)||(md==14)||(md==22)||(md==(mml-1))) sabbatheve=1;
yatyaza=0; m1=mm%4; wd1=Math.floor(m1/2)+4;
wd2=((1-Math.floor(m1/2))+m1%2)*(1+2*(m1%2));
if((wd==wd1)||(wd==wd2)) yatyaza=1;
thamanyo=0; m1=mm-1-Math.floor(mm/9); wd1=(m1*2-Math.floor(m1/8))%7;
wd2=(wd+7-wd1)%7; if(wd2<=1) thamanyo=1;
amyeittasote=0; wda=[5,8,3,7,2,4,1]; if(d==wda[wd]) amyeittasote=1;
warameittugyi=0; wda=[7,1,4,8,9,6,3]; if(d==wda[wd]) warameittugyi=1;
warameittunge=0; wn=(wd+6)%7; if((12-d)==wn) warameittunge=1;
yatpote=0; wda=[8,1,4,6,9,8,7]; if(d==wda[wd]) yatpote=1;
thamaphyu=0; wda=[1,2,6,6,5,6,7];  if(d==wda[wd]) thamaphyu=1;
wda=[0,1,0,0,0,3,3]; if(d==wda[wd]) thamaphyu=1;
if((d==4) && (wd==5)) thamaphyu=1;
nagapor=0; wda=[26,21,2,10,18,2,21];  if(md==wda[wd]) nagapor=1;
wda=[17,19,1,0,9,0,0]; if(md==wda[wd]) nagapor=1;
if(((md==2)&&(wd==1))||(((md==12)||(md==4)||(md==18))&&(wd==2)))nagapor=1;
yatyotema=0; m1=(mm%2)?mm:((mm+9)%12); m1=(m1+4)%12+1; if(d==m1)yatyotema=1;
mahayatkyan=0; m1=(Math.floor((mm%12)/2)+4)%6+1; if(d==m1) mahayatkyan=1;
shanyat=0; sya=[8,8,2,2,9,3,3,5,1,4,7,4]; if(d==sya[mm-1]) shanyat=1;
nagahle=Math.floor((mm%12)/3);
mahabote=(my-wd)%7;
nakhat=my%3;

return {sabbath:sabbath,sabbatheve:sabbatheve,yatyaza:yatyaza,
warameittugyi:warameittugyi,warameittunge:warameittunge,
yatpote:yatpote,thamaphyu:thamaphyu,nagapor:nagapor,
yatyotema:yatyotema,mahayatkyan:mahayatkyan,shanyat:shanyat,
nagahle:nagahle,mahabote:mahabote,nakhat:nakhat};
}


Related post: Algorithm, Program and Calculation of Myanmar Calendar