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.
समं कृत्वा महीं तत्र सूत्रं प्राक् प्रत्यग् आयतम्। नाभौ संस्थाप्य सूत्रस्य भ्रमयेन्मण्डलं बुधः॥
samaṃ kṛtvā mahīṃ tatra sūtraṃ prāk pratyag āyatam | nābhau saṃsthāpya sūtrasya bhramayen maṇḍalaṃ budhaḥ ||
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
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 transformed2. 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
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
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)