Sri Yantra: Mathematical Construction and Visualization
The Sri Yantra (also known as Sri Chakra or the Great Yantra) is one of the most mathematically complex geometric diagrams from ancient India, dating back to at least the 7th-8th century A.D. The earliest known specimens include a portrait in the Śrngari Matha (8th century A.D.) and mentions in Buddhist inscriptions from 7th century A.D. South Sumatra.

Here’s the code to look at and to test with the online compiler, and an explanation will follow:
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{backgrounds,math}
\begin{document}
\pgfdeclarelayer{minus1}
\pgfdeclarelayer{minus2}
\pgfdeclarelayer{minus3}
\pgfsetlayers{minus3,minus2,minus1,background,main}
\begin{tikzpicture}
% Base parameters
\def\cx{150}
\def\cy{150}
\def\scale{0.025}
\def\triangleData{%
{53.65669559977147}{123.20508075688774}{250}{246.34330440022853}{0}% D1
{52.984011026495736}{174.24660560764943}{50}{247.01598897350425}{1}% U1
{98.71823312733801}{220.03828947357886}{123.20508075688774}{201.281766872662}{1}% U3
{78.26467997914015}{197.92315674002487}{78.10499177949904}{221.73532002085986}{1}% U2
{90.4856922951427}{78.10499177949904}{160.66014976539617}{209.51430770485734}{0}% D3
{80.98384838952128}{103.12199145016105}{220.03828947357886}{219.0161516104787}{0}% D2
{114.9488500600036}{160.66014976539617}{103.12199145016105}{185.0511499399964}{1}% U4
{116.35142605010424}{134.30757626706648}{197.92315674002487}{183.64857394989576}{0}% D4
{124.61190803072795}{144.79777263138968}{174.24660560764943}{175.38809196927207}{0}% D5
}
% Function to transform and draw triangle
% Usage: \drawtriangle{x1}{y1}{x2}{y2}{x3}{y3}
\newcommand{\drawtriangle}[6]{%
\draw[thick] ({((#1-\cx)*\scale)},{(-(#2-\cy)*\scale)}) --
({((#3-\cx)*\scale)},{(-(#4-\cy)*\scale)}) --
({((#5-\cx)*\scale)},{(-(#6-\cy)*\scale)}) -- cycle;%
}
% Macro to draw a triangle from array data
% Arguments: left_x, top/base_y, center_y, right_x, type
\newcommand{\drawTriangleFromData}[5]{%
\ifnum#5=0
% Downward triangle: left_x, top_y, center_x, center_y, right_x, top_y
\drawtriangle{#1}{#2}{\cx}{#3}{#4}{#2}%
\else
% Upward triangle: left_x, base_y, center_x, center_y, right_x, base_y
\drawtriangle{#1}{#2}{\cx}{#3}{#4}{#2}%
\fi
}
% Recursive macro to process triangle data
% Stops when it encounters \relax as the first argument
\def\processTriangleData#1#2#3#4#5{%
\ifx\relax#1\relax
% End of data reached
\else
\drawTriangleFromData{#1}{#2}{#3}{#4}{#5}%
\expandafter\processTriangleData
\fi
}
% Outer circle
\draw[thick, fill=white!30!white] (0,0) circle (2.5cm);
% Center bindu
\draw[fill=red] (0,0) circle (0.1cm);
% Draw all triangles from triangleData array
\expandafter\processTriangleData\triangleData\relax\relax\relax\relax\relax
%Step-11
\begin{scope}[on background layer]
\draw [fill=yellow] circle (3cm);
\foreach \i [evaluate=\i as \start using 22.5+45*\i] in {0,...,7}
\draw[fill=green!30!black] (\start:2.5) .. controls ({\start-5}:2.85) and ({\start-17.5}:2.75) .. ({\start-22.5}:3) .. controls ({\start-27.5}:2.75) and ({\start-40}:2.85) .. ({\start-45}:2.5) arc [start angle={\start-45}, delta angle=45, radius=2.5cm]--cycle;
\end{scope}
%Step-12
\begin{pgfonlayer}{minus1}
\draw [fill=orange] circle (3.5cm);
\foreach \i [evaluate=\i as \start using 11.25+22.5*\i] in {0,...,15}
\draw[fill=blue!30] (\start:3) .. controls ({\start-2.5}:3.35) and ({\start-8.75}:3.25) .. ({\start-11.25}:3.5) .. controls ({\start-13.75}:3.25) and ({\start-20}:3.35).. ({\start-22.5}:3) arc [start angle={\start-11.25}, delta angle=22.5, radius=3.5cm]--cycle;
\end{pgfonlayer}
%Step-13
\begin{pgfonlayer}{minus2}
\draw [fill=yellow!39] circle (4cm);
\draw [line width=2mm, blue!70!black] circle (3.75cm);
\end{pgfonlayer}
%Step-14
\begin{pgfonlayer}{minus3}
\node [fill=black, minimum size=8cm] (b) {};
\node [fill=black, minimum width=9.25cm, minimum height=3cm] (bh) {};
\node [fill=black, minimum height=9.25cm, minimum width=3cm] (bv) {};
\node [fill=black, minimum height=6mm, minimum width=6cm] at (bv.north) (bn) {};
\node [fill=black, minimum height=6mm, minimum width=6cm] at (bv.south) (bs) {};
\node [fill=black, minimum width=6mm, minimum height=6cm] at (bh.west) (bw) {};
\node [fill=black, minimum width=6mm, minimum height=6cm] at (bh.east) (be) {};
\draw [red!60!black,line width=1mm]%
(be.south west)-|(be.north east)-|(bh.north-|be.west)-|(b.north east)-|(bv.east|-bn.south)-|(bn.north east)-|(bn.south west)-|(b.north-|bv.west)-|(b.west|-bh.north)-|(bw.north east)-|(bw.south west)-|(bw.east|-bh.south)-|(b.south west)-|(bv.west|-bs.north)-|(bs.south west)-|(bs.north east)-|(bv.east|-b.south)-|(b.east|-bh.south)-|cycle;
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
This work is derived partially from the above-mentioned research papers; however, the previous works contained several mathematical errors in coordinate calculations and failed to achieve precise superposition of intersection points, resulting in inaccurate triangle vertex positions. The previous interlockings resulted in holes within the intersections, where intersections formed polygons instead of precise points. This implementation corrects the above works and provides verified coordinates that ensure accurate interlocking of Sri Chakram with precise superposition of all nine triangles at all intersection points. While it is not possible to completely remove all errors in such a complex geometric construction, this work minimizes them to a negligible extent.
Mathematical Construction Complexity
The precise reproduction of the Sri Yantra central seal (14-angled polygon
composed by the intersection of nine triangles) is a highly difficult problem
that exceeds the capacity of hand-drawing. The structure consists of
- Nine interlocking triangles (4 upward, 5 downward) forming 43 smaller triangles through their intersections
- Most lines pass through 3-6 points of intersection, requiring precise superposition that is nearly impossible to achieve manually
The construction involves four structural components, each requiring iterative
procedures with three levels of enclosure. If we designate the number of
iterative steps for components 1-4 as a, b, c, d, respectively, the total
work required is: N = a*d + b*c*d + c*d + d.
This exponential growth in complexity makes accurate hand-drawing extremely
difficult, requiring computational assistance for precise construction.
Classification of Sri Yantra Types
Based on mathematical analysis of available specimens, three main types have
been identified:
Type I: Described by incomplete system of equations (2-3 equations from a
complete 4-equation system). Solutions are functions, allowing
continuous deformation. Most prevalent type (70% of specimens),
found in 17-19th century A.D., mostly on paper.
Type II: Also described by incomplete system (2-3 equations), allowing
continuous deformation. Some specimens are near the plane limits
of Type III. Found in 18-20th century A.D. (20% of specimens).
Type III: Described by complete system of 4 equations with 4 variables.
Solutions are discrete roots, making these portrayals rigid and
undeformable. Most mathematically precise type, found in specimens
from 17th century A.D. or earlier (10% of specimens), typically
on metal plates (cast) or stone. These may represent the original
prototype preserved through precise matrix-copying methods.
Type III₁: A special linear case of Type III, where points C and D are
strictly fixed at the outer circumference.
Spherical vs. Plane Construction Theory
Some rare specimens (Type III variants) use arcs of ovals or ellipses instead
% of straight lines, suggesting they may be plane projections of a spherical
image. The spherical construction theory proposes:
- The outer circumference is formed by a side cross-section of a sphere
- Triangle sides are geodesic lines on the sphere (formed by central
cross-sections) - The position is determined by an angle α relative to the sphere’s axis
- As α → 0, the spherical image transforms to its linear limit (Type III₁)
Mathematical Analysis
The general analytical aspect of the polygon requires solving systems of
linear and circular equations with coordinate superposition. Type III and
Type III₁ portrayals are described by complete systems of equations, making
them mathematically rigid. Type I and II portrayals, being described by
incomplete systems, allow continuous deformation and may represent
simplifications that arose from centuries-old accumulation of copying errors.
The investigation of Type III₁ seals has not revealed correlations expressed
in whole numbers, vulgar fractions, or well-known transcendental constants,
indicating the mathematical relationships are more complex than simple
geometric ratios.
Historical Development
The mathematical sequence Type III → Type III₁ → Type II → Type I represents
a progression from general to special cases. This suggests Type III may be
the hypothetical original, with others being successive simplifications
resulting from copying errors over centuries. The prevalence of simpler,
more contemporary types (I and II) supports this theory, as they were
produced using less precise drawing instruments compared to the casting
methods used for Type III specimens.
References:
- Kulaichev, A.P. (1984). “Sriyantra and its Mathematical Properties.”
Journal of Indian Philosophy, 12(2), 161-184.
Available at: http://protein.bio.msu.ru/~akula/Kulaichev%20math.pdf - Huet, G. “Sri Yantra: Construction and Mathematical Properties.”
ResearchGate publication.
Available at: https://www.researchgate.net/profile/Gerard-Huet/publication/277295011_Sri_Yantra/links/55af62d008aed9b7dcddbc42/Sri-Yantra.pdf
Methodology
- Define Base Parameters:
– Establish center coordinates (cx, cy) and scale factor for coordinate
transformation from original SVG coordinates to the TikZ coordinate system
– Original coordinate system: center at (150, 150), radius 100
– TikZ coordinate system: center at (0, 0), radius 2.5cm
– Scale factor: 2.5/100 = 0.025
– Y-axis transformation: y_tikz = -(y_original – 150) * 0.025 - Calculate Triangle Coordinates:
– Define coordinates for all nine triangles using precise geometric
calculations derived from line-line intersection formulas
– Each triangle is defined by three vertices:
* Downward triangles (D1-D5): left_x, top_y, center_y, right_x, top_y
* Upward triangles (U1-U4): left_x, base_y, center_y, right_x, base_y
– Store coordinates as variables using \pgfmathsetmacro for proper
expansion in mathematical expressions - Implement Drawing Function:
– Create \drawtriangle macro that takes 6 parameters (x1, y1, x2, y2,
x3, y3) representing three vertices
– Apply coordinate transformation to convert from the original coordinate
system to TikZ coordinate system
– Draw a closed triangle path using \draw command - Draw All Components:
– Draw outer circle (boundary of the yantra)
– Draw center bindu (red dot at origin)
– Draw all nine triangles using the \drawtriangle function with
calculated coordinates
– Draw decorative elements (lotus petals, bhupura) on background layers
Mathematical Formulation for Coordinate Derivation:
1. Triangle Edge Line Equations:
For a triangle with vertices P₁(x₁, y₁), P₂(x₂, y₂), P₃(x₃, y₃):
Edge P₁P₂:
If x₁ ≠ x₂: y = m₁₂(x – x₁) + y₁, where m₁₂ = (y₂ – y₁)/(x₂ – x₁)
If x₁ = x₂: x = x₁ (vertical line)
Edge P₂P₃:
If x₂ ≠ x₃: y = m₂₃(x – x₂) + y₂, where m₂₃ = (y₃ – y₂)/(x₃ – x₂)
If x₂ = x₃: x = x₂ (vertical line)
Edge P₃P₁:
If x₃ ≠ x₁: y = m₃₁(x – x₃) + y₃, where m₃₁ = (y₁ – y₃)/(x₁ – x₃)
If x₃ = x₁: x = x₃ (vertical line)
2. Line-Line Intersection Formula:
Given two lines:
L₁: y = m₁x + c₁ (or x = k₁ for vertical)
L₂: y = m₂x + c₂ (or x = k₂ for vertical)
Intersection point I(xᵢ, yᵢ):
Case 1: Both lines non-vertical (m₁ ≠ ∞, m₂ ≠ ∞):
xᵢ = (c₂ – c₁)/(m₁ – m₂), provided m₁ ≠ m₂
yᵢ = m₁xᵢ + c₁ = m₂xᵢ + c₂
Case 2: L₁ vertical (x = k₁), L₂ non-vertical:
xᵢ = k₁
yᵢ = m₂k₁ + c₂
Case 3: L₂ vertical (x = k₂), L₁ non-vertical:
xᵢ = k₂
yᵢ = m₁k₂ + c₁
Case 4: Both vertical (x = k₁, x = k₂):
If k₁ = k₂: Lines coincide (infinite intersections)
If k₁ ≠ k₂: Lines parallel, no intersection
3. System of Equations for Sri Yantra:
For 9 triangles with 27 edges total, we have:
Let Tᵢ (i = 1 to 9) represent the i-th triangle with vertices:
Tᵢ = {Vᵢ₁(xᵢ₁, yᵢ₁), Vᵢ₂(xᵢ₂, yᵢ₂), Vᵢ₃(xᵢ₃, yᵢ₃)}
Each triangle has 3 edges Eᵢⱼ (j = 1, 2, 3):
Eᵢ₁: edge from Vᵢ₁ to Vᵢ₂
Eᵢ₂: edge from Vᵢ₂ to Vᵢ₃
Eᵢ₃: edge from Vᵢ₃ to Vᵢ₁
For each intersection point Iₖ where edges Eᵢⱼ and Eₚᵩ intersect:
Iₖ = Intersection(Eᵢⱼ, Eₚᵩ)
The system requires that all intersection points are precisely
superposed, meaning:
For any two edges Eᵢⱼ and Eₚᵩ that should intersect at point P:
Distance(Intersection(Eᵢⱼ, Eₚᵩ), P) < ε (where ε is negligible)
4. Geometric Constraints:
a) Symmetry constraint (vertical axis at x = 150):
For triangle Tᵢ with left vertex (xₗ, y) and right vertex (xᵣ, y):
xₗ + xᵣ = 2 × 150 = 300
xᵣ = 300 – xₗ
b) Triangle vertex constraints:
Each triangle vertex must lie on the triangle’s edges:
For triangle Tᵢ with vertices Vᵢ₁, Vᵢ₂, Vᵢ₃:
Vᵢ₁ ∈ Eᵢ₃ (lies on edge from Vᵢ₃ to Vᵢ₁)
Vᵢ₂ ∈ Eᵢ₁ (lies on edge from Vᵢ₁ to Vᵢ₂)
Vᵢ₃ ∈ Eᵢ₂ (lies on edge from Vᵢ₂ to Vᵢ₃)
c) Intersection point constraints:
When multiple edges intersect at the same point P(xₚ, yₚ):
For all edges Eᵢⱼ passing through P:
P ∈ Eᵢⱼ (point P satisfies the line equation of Eᵢⱼ)
5. Optimization Objective:
Minimize the total error function:
E = Σᵢⱼₚᵩ |Distance(Intersection(Eᵢⱼ, Eₚᵩ), Expected_Point)|
Subject to constraints:
- All triangle vertices satisfy triangle edge equations
- Symmetry is maintained (xₗ + xᵣ = 300)
- All intersection points are precisely superposed
- No gaps or polygons at intersection points
6. Iterative Solution Method:
Using Newton-Raphson or similar iterative method:
Step 1: Initialize triangle parameters (centers, scales, orientations)
Step 2: Calculate all edge equations
Step 3: Compute all intersection points
Step 4: Calculate error E
Step 5: If E > ε:
- Compute gradient ∂E/∂parameters
- Update parameters: params_new = params_old – α·∇E
- Return to Step 2
- Else:
– Solution converged
Where α is the learning rate and ε is the convergence threshold.
7. Final Coordinate Values:
The coordinates listed below are the solutions to this system,
obtained through the iterative refinement process, ensuring:
- Precise superposition at all intersection points
- No holes or polygon formations
- Symmetry around x = 150
- Errors minimized to a negligible extent
Triangle coordinates (solutions to the mathematical system above)
Store coordinates in a structured way
Triangle data: {left_x, top/base_y, center_y, right_x, type}
type: 0 = downward (uses top_y), 1 = upward (uses base_y)
Bhaskar Tripathi, PhD (Financial Mathematics), https://www.bhaskartripathi.com