Algorithm to find Dasamsha chart from birth chart

1) Sign number of the planet in birth chart (D-1)
2) Degrees of planet in birth chart
3) Minutes of planet in birth chart

And gives the sign number of planet in dasamsha chart. As shown in below
diagram.

Step 1: First we must find the Planets degrees in minutes in its sign.

PD_loc_min = [ (deg * 60) + min ]

Step 2: Dasamsa refers to dividing a sign into 10 parts. (dasa means 10
and amsa means parts in Sanskrit). Since each sign is of 30 degrees,
each part or amsa is of 3 degrees or 180 minutes for dasamsa.

amsa = 180 minutes

Let’s call this as “n”
n = [ (PD_loc_min / amsa) + 1 ]
This means that the planet is in nth dasamsha in its sign.
if (SignNum == EVEN) // for even signs
{
m = (SignNum + 8) mod 12
if (m == 0)
{ m = 12 }
}
else // for odd signs
{ m = SignNum }
.
 If the sign is even.Step 3: Now we have to find in which dasamsha of the sign is the planet
present in. the starting sign from which counting must begin
differs based of if sign is even sign or odd sign.
 If the sign is odd.
Step 4: In dasamsa. the 10 parts of the sign go into the 10
consecutive signs starting from the 9th sign from the sign in
question.
Let’s denote the starting sign number from where the counting must
begin as “m”. the 10 parts of the sign go into the 10
consecutive signs starting from the sign itself.

In D-10 chart the
planets doesn’t have separate degrees. The degrees is considered same
as in D1 chart.
D10_SignNum = [ (m + n – 1) mod 12 ]
If (D10_SignNum == 0)
{ D10_SignNum = 12 }
Step 6: This “D10_SignNum” is the required output. The results are plotted on a chart and
resulting chart is a Dasamsa chart or D-10 chart.Step 5: To find the Sign number of planet in Dasamsha (D-10) Chart.
. we have to count till nth Dasamsha. The
resulting sign is planets sign in D-10 chart. This is calculated
for all 9 planets and ascendant.
Starting from sign num m.