Skip to main content
B · Classical commentaryChapter 2

Geometric Foundations & Centroid Mathematics

The rigorous computational geometry powering Vāstu analysis: converting arbitrary polygon boundaries, architectural floor plans, and geodetic coordinates into an aligned, centered Vāstu reference frame.

MayamataCh. 6 (Bhūparīkṣā), v. 12
B · Classical commentary

समं कृत्वा महीं तत्र सूत्रं प्राक् प्रत्यग् आयतम्। नाभौ संस्थाप्य सूत्रस्य भ्रमयेन्मण्डलं बुधः॥

samaṃ kṛtvā mahīṃ tatra sūtraṃ prāk pratyag āyatam | nābhau saṃsthāpya sūtrasya bhramayen maṇḍalaṃ budhaḥ ||

Translation:Leveling the ground meticulously, draw a true east-west cord. Anchoring the central pivot at the Nābhi (centroid), the wise architect sweeps the sacred circle to derive the cardinal quadrants.

1. True North vs. Magnetic North & Rotation Transforms

A fundamental error in modern popular Vāstu practice is using a handheld magnetic compass without correcting for magnetic declination ($\delta$). A magnetic compass points toward Earth’s shifting magnetic pole, which can diverge from true astronomical north by several degrees. Classical treatises strictly define North astronomically using the solar gnomon (*Śaṅku*) and Polaris (*Dhruva Tārā*).

2D True North Coordinate Rotation Matrix

Rotates polygon vertices around plot centroid into standard cardinal frame

θ_effective = (θ_measured + δ_declination) mod 360°
x' = (x - C_x) cos(θ) - (y - C_y) sin(θ)
y' = (x - C_x) sin(θ) + (y - C_y) cos(θ)
Every point (x, y) on a surveyed boundary polygon or floor plan is translated so the centroid lies at (0, 0) and rotated counter-clockwise by θ so that True North aligns strictly with the positive Y-axis.
Parameters & variables
θ_measured
Measured Orientation: Plot azimuth relative to north(degrees)
δ_declination
Magnetic Declination: Local magnetic deviation from true astronomical north(degrees)
(C_x, C_y)
Polygon Nābhi Centroid: Cartesian coordinates of the sacred center(meters/feet)

Implementation reference

import math

def rotate_to_true_north(points, centroid, theta_degrees):
    rad = math.radians(theta_degrees)
    cos_t, sin_t = math.cos(rad), math.sin(rad)
    cx, cy = centroid
    
    transformed = []
    for x, y in points:
        dx, dy = x - cx, y - cy
        x_rot = dx * cos_t - dy * sin_t
        y_rot = dx * sin_t + dy * cos_t
        transformed.append((x_rot, y_rot))
    return transformed

2. The Shoelace Nābhi (Centroid) Formulation

While rectangular plots have an obvious center, contemporary architectural plots frequently have irregular, trapezoidal, L-shaped, or polygonal geometries. Computing the true Nābhi (Brahma Bindu)requires Green’s Theorem polygon integration (the Shoelace Centroid Algorithm):

Polygon Signed Area & Centroid Coordinates

Exact geometric center of mass for an arbitrary N-sided closed polygon

Complexity: O(N) single-pass linear time
A = (1/2) Σ [x_i × y_{i+1} - x_{i+1} × y_i] (for i = 0 to N-1)
C_x = (1 / 6A) Σ [(x_i + x_{i+1}) × (x_i × y_{i+1} - x_{i+1} × y_i)]
C_y = (1 / 6A) Σ [(y_i + y_{i+1}) × (x_i × y_{i+1} - x_{i+1} × y_i)]
This computes the exact center of mass (Nābhi) around which the 16 directional zones and 32 entrance padas radially emanate. Even with re-entrant concave corners, this formulation guarantees mathematical rigor.
Parameters & variables
N
Number of Vertices: Count of boundary polygon vertices (with vertex N = vertex 0)(integer)
A
Signed Polygon Area: Total enclosed floor or plot area(m² or ft²)
(C_x, C_y)
Centroid Coordinates: The exact geometric Nābhi of the site(meters/feet)

Implementation reference

def compute_polygon_centroid(vertices):
    """Computes (A, Cx, Cy) using Shoelace integration."""
    n = len(vertices)
    area = 0.0
    cx = 0.0
    cy = 0.0
    for i in range(n):
        x0, y0 = vertices[i]
        x1, y1 = vertices[(i + 1) % n]
        cross = (x0 * y1 - x1 * y0)
        area += cross
        cx += (x0 + x1) * cross
        cy += (y0 + y1) * cross
    area *= 0.5
    cx /= (6.0 * area)
    cy /= (6.0 * area)
    return abs(area), (cx, cy)

3. Ray-Casting & Angular Zone Slicing

Once the Nābhi $(C_x, C_y)$ and True North orientation $\theta$ are established, any arbitrary point $P(x, y)$ inside the building is mapped to its precise directional zone via four-quadrant arctangent (`atan2`):

Ray-Casting Azimuth to Directional Zone

α_raw = atan2(x - C_x, y - C_y) × (180° / π)
α = (α_raw - θ_north + 360°) mod 360°
Zone_16 = ⌊ (α + 11.25°) / 22.5° ⌋ mod 16
Pada_32 = ⌊ (α + 5.625°) / 11.25° ⌋ mod 32
Notice the half-step offset (+11.25° for 16 zones, +5.625° for 32 padas). This ensures that the primary cardinal axes (North, East, South, West) form the exact center of their respective 22.5° sectors (e.g. North spans 348.75° to 11.25°).
Parameters & variables
α
Effective Azimuth: Clockwise angle from True North ray(0° to 359.999°)
Zone_16
16-Directional Sector: 0 (North), 1 (NNE), 2 (NE), ... 15 (NNW)(0 to 15)
Pada_32
32-Pada Sector: 0 to 31 perimeter doorway segments(0 to 31)