Skip to content

Vastu Purusha Mandala, in code

See exactly how the 45 devtas land on any plot

Open code for the 64 Pada and 81 Pada devta grids and the Aay Vastu check. Every ring, angle and table is written out in plain JavaScript that you can read, change and run right here.

  • Drag the plot corners and the grid follows
  • Edit a table or a formula and watch the drawing change
  • Copy the code into your own software, it has no imports
81 Pada devta grid on a 45 by 45 ft plot, drawn by the code in the 81 Pada editor
Real output of pada-81.js on a 45 by 45 ft plot.

Three editors

Code on one side, the answer on the other

Each editor holds one complete JavaScript file. It runs in your browser every time you change the code or the plot, so you always see what the maths really does.

64 Pada devta grid on a 40 by 50 ft plot

Manduka, 8 by 8

64 Pada devta grid

32 compass zones, each cut at 1/4, 1/2 and 3/4 of the way from the centre to the plot edge.

  • Zone table you can edit band by band
  • Devta areas and shares of the plot
  • Shown here on a 40 by 50 ft plot
Open the 64 Pada editor
81 Pada devta grid on a plot with a cut corner

Paramashayika, 9 by 9

81 Pada devta grid

Four bhumis at 3/9, 5/9 and 7/9, fixed compass spans in the middle ring and 32 turned zones outside.

  • Brahm, Dev, Manushya and Pishach Bhumi
  • Works on cut and extended corners
  • Shown here on a plot with a cut corner
Open the 81 Pada editor

// aay-vastu.js
const product = Math.trunc(L * W)
const aay = product % 8 || 8

  1. 1Dhwajaya
  2. 2Dromaya
  3. 3Simhaya
  4. 4Sunakaya
  5. 5Vrushabhaya
  6. 6Karayashaya
  7. 7Gajashaya
  8. 8Vayasaya

Size check

Aay Vastu calculator

Length times width in square inches, divided by 8. The remainder names the Aay, with an extra check for whole properties.

  • Feet and inches or metres and cm
  • All eight Aay with what each suits
  • Property check with varA and varB
Open the Aay calculator

The method

How the grids are built

Both grids start from the classic square mandala and keep its proportions on a real plot. The code finds the centre of the plot, reads every direction as a compass bearing, and cuts the way from the centre to each wall into the same shares as the padas of the square.

64 Pada ringsLines after 1, 2 and 3 of the 4 padas from the centre.
1/41/23/4Brahma
81 Pada bhumisLines after 1.5, 2.5 and 3.5 of the 4.5 padas from the centre.
3/9 0.33335/9 0.55557/9 0.7777Brahma
Differences between the 64 Pada and 81 Pada grids
Part of the grid64 Pada81 Pada
Square grid8 by 8 padas, 4 from centre to edge9 by 9 padas, 4.5 from centre to edge
Brahma (1)Centre to 1/4 of the way outCentre to 0.3333 of the way out
Devtas 2 to 51/4 to 1/2, 90° each, N, E, S and W0.3333 to 0.7777, 54° each
Devtas 6 to 131/2 to 3/4, two corner zones each0.3333 to 0.7777, 18° each
Devtas 14 to 45One zone each, from 3/4 (corner zones) or 1/2 (middle zones) to the edgeOne zone each, 0.7777 to the edge
Zones32 of 11.25°, North on the N4 and N5 lineThe same 32, turned back 5.65° so Soma is centred on North
The heart of buildCell(), shared by both grids
// One cell is a compass slice of the plot shrunk to its outer line,// minus the same slice of the plot shrunk to its inner line.const outer = sectorEdge(scaleAbout(plot, center, spec.outer), center, from, span)const inner = sectorEdge(scaleAbout(plot, center, spec.inner), center, from, span)outline = outer.points.concat(inner.points.slice().reverse())area = Math.abs(outer.area - inner.area)
  • Shrinking the outline keeps every ring line parallel to the walls, so a band always covers the same share of the way out, whatever the shape.
  • Slicing by bearing clips that shape to the compass span of the zone, which also catches corners and extensions behind it.
  • Subtracting areas gives each devta its exact share of the plot, and all cells together add up to the full plot area.

Reference

The 45 devtas and where the code puts them

Positions read from the original tables in both editors. Shares are measured from the centre of the plot (0) to its edge (1), and bearings are compass degrees with North at 0°.

  • Brahm Bhumi
  • Dev Bhumi
  • Manushya Bhumi
  • Pishach Bhumi
Placement of all 45 devtas in the 64 Pada and 81 Pada grids
No.Devta64 Pada81 Pada
Brahm BhumiThe centre of the plot
1BrahmaCentre, 0 to 1/4 of the way outWhole centre, 0 to 0.3333
Dev BhumiThe four devtas facing the main directions
2BudharN1 to N8, 1/4 to 1/2 out (inner band)333° to 27°, 0.3333 to 0.7777
3AryamaE1 to E8, 1/4 to 1/2 out (inner band)63° to 117°, 0.3333 to 0.7777
4ViviswanS1 to S8, 1/4 to 1/2 out (inner band)153° to 207°, 0.3333 to 0.7777
5MitraW1 to W8, 1/4 to 1/2 out (inner band)243° to 297°, 0.3333 to 0.7777
Manushya BhumiThe eight devtas of the inner corners
6ApahaN7, N8, 1/2 to 3/4 out (third band)27° to 45°, 0.3333 to 0.7777
7ApahavatsaE1, E2, 1/2 to 3/4 out (third band)45° to 63°, 0.3333 to 0.7777
8SavitaE7, E8, 1/2 to 3/4 out (third band)117° to 135°, 0.3333 to 0.7777
9SavitraS1, S2, 1/2 to 3/4 out (third band)135° to 153°, 0.3333 to 0.7777
10IndraS7, S8, 1/2 to 3/4 out (third band)207° to 225°, 0.3333 to 0.7777
11JayaW1, W2, 1/2 to 3/4 out (third band)225° to 243°, 0.3333 to 0.7777
12RudraW7, W8, 1/2 to 3/4 out (third band)297° to 315°, 0.3333 to 0.7777
13RajayakshmaN1, N2, 1/2 to 3/4 out (third band)315° to 333°, 0.3333 to 0.7777
Pishach BhumiThe 32 devtas around the edge
14ShikhiE1, 3/4 to 1 out (outer band), 45° to 56.25°E1, 39.35° to 50.6°, 0.7777 to 1
15PrajanyaE2, 3/4 to 1 out (outer band), 56.25° to 67.5°E2, 50.6° to 61.85°, 0.7777 to 1
16JayantE3, 1/2 to 1 out (third band), 67.5° to 78.75°E3, 61.85° to 73.1°, 0.7777 to 1
17MahendraE4, 1/2 to 1 out (third band), 78.75° to 90°E4, 73.1° to 84.35°, 0.7777 to 1
18SuryaE5, 1/2 to 1 out (third band), 90° to 101.25°E5, 84.35° to 95.6°, 0.7777 to 1
19SatyaE6, 1/2 to 1 out (third band), 101.25° to 112.5°E6, 95.6° to 106.85°, 0.7777 to 1
20BrishaE7, 3/4 to 1 out (outer band), 112.5° to 123.75°E7, 106.85° to 118.1°, 0.7777 to 1
21AkashE8, 3/4 to 1 out (outer band), 123.75° to 135°E8, 118.1° to 129.35°, 0.7777 to 1
22AnilS1, 3/4 to 1 out (outer band), 135° to 146.25°S1, 129.35° to 140.6°, 0.7777 to 1
23PushaS2, 3/4 to 1 out (outer band), 146.25° to 157.5°S2, 140.6° to 151.85°, 0.7777 to 1
24VithathaS3, 1/2 to 1 out (third band), 157.5° to 168.75°S3, 151.85° to 163.1°, 0.7777 to 1
25GrihaspatyaS4, 1/2 to 1 out (third band), 168.75° to 180°S4, 163.1° to 174.35°, 0.7777 to 1
26YamaS5, 1/2 to 1 out (third band), 180° to 191.25°S5, 174.35° to 185.6°, 0.7777 to 1
27GandharvaS6, 1/2 to 1 out (third band), 191.25° to 202.5°S6, 185.6° to 196.85°, 0.7777 to 1
28BhringrajS7, 3/4 to 1 out (outer band), 202.5° to 213.75°S7, 196.85° to 208.1°, 0.7777 to 1
29MrigaS8, 3/4 to 1 out (outer band), 213.75° to 225°S8, 208.1° to 219.35°, 0.7777 to 1
30PitraW1, 3/4 to 1 out (outer band), 225° to 236.25°W1, 219.35° to 230.6°, 0.7777 to 1
31DuawarikW2, 3/4 to 1 out (outer band), 236.25° to 247.5°W2, 230.6° to 241.85°, 0.7777 to 1
32SugreevW3, 1/2 to 1 out (third band), 247.5° to 258.75°W3, 241.85° to 253.1°, 0.7777 to 1
33PuspadantaW4, 1/2 to 1 out (third band), 258.75° to 270°W4, 253.1° to 264.35°, 0.7777 to 1
34VarunW5, 1/2 to 1 out (third band), 270° to 281.25°W5, 264.35° to 275.6°, 0.7777 to 1
35AsurW6, 1/2 to 1 out (third band), 281.25° to 292.5°W6, 275.6° to 286.85°, 0.7777 to 1
36ShoshaW7, 3/4 to 1 out (outer band), 292.5° to 303.75°W7, 286.85° to 298.1°, 0.7777 to 1
37PapyakshamaW8, 3/4 to 1 out (outer band), 303.75° to 315°W8, 298.1° to 309.35°, 0.7777 to 1
38RogaN1, 3/4 to 1 out (outer band), 315° to 326.25°N1, 309.35° to 320.6°, 0.7777 to 1
39NagaN2, 3/4 to 1 out (outer band), 326.25° to 337.5°N2, 320.6° to 331.85°, 0.7777 to 1
40MukhyaN3, 1/2 to 1 out (third band), 337.5° to 348.75°N3, 331.85° to 343.1°, 0.7777 to 1
41BhallatN4, 1/2 to 1 out (third band), 348.75° to 0°N4, 343.1° to 354.35°, 0.7777 to 1
42SomaN5, 1/2 to 1 out (third band), 0° to 11.25°N5, 354.35° to 5.6°, 0.7777 to 1
43BhujangN6, 1/2 to 1 out (third band), 11.25° to 22.5°N6, 5.6° to 16.85°, 0.7777 to 1
44AditiN7, 3/4 to 1 out (outer band), 22.5° to 33.75°N7, 16.85° to 28.1°, 0.7777 to 1
45DitiN8, 3/4 to 1 out (outer band), 33.75° to 45°N8, 28.1° to 39.35°, 0.7777 to 1

Aay at a glance

One remainder, eight answers

Aay rates a room or plot size by what is left over when its area in square inches is divided by 8. A whole plot or house also gets a second check: the area mod 8 has to be greater than three times the area mod 8.

  1. 1

    Convert

    Length and width into inches. 1 ft is 12 in, 1 m is 100 / 2.54 in.

  2. 2

    Multiply

    Length times width, keeping whole square inches only.

  3. 3

    Divide by 8

    The remainder is the Aay. A remainder of 0 means Aay 8.

Open the Aay calculator
  • 1Dhwajaya

    ध्वजाय

    The most auspicious Aay. Good for homes, main doors, shops and offices, temples, puja rooms and yajna areas.

  • 2Dromaya

    द्रुमाय

    Linked to fire. Good for kitchens, havan kunds and other places where fire is used.

  • 3Simhaya

    सिंहाय

    Linked to power. Good for the main entrance, seats of authority and the homes of leaders.

  • 4Sunakaya

    श्वानाय

    Good for service areas such as staff rooms, toilets and bathrooms.

  • 5Vrushabhaya

    वृषभाय

    Linked to trade and food. Good for shops, factories, dining rooms and cattle sheds.

  • 6Karayashaya

    खरायशाय

    Good for labour quarters and sheds for working animals.

  • 7Gajashaya

    गजाशय

    Linked to rest. Good for bedrooms, dressing rooms, garages, beds and pillows.

  • 8Vayasaya

    वायसाय

    Good for artist studios, yoga and meditation rooms, and rooms for monks or sages.

Change one number and see what moves

Try 0.3 instead of 0.3333 for Brahm Bhumi, or turn the outer zones by a full 11.25°, and the grid redraws on the spot.