भारत · ग्रहगणित
स्थान उज्जयिनी Ujjayinī · change it on a tool⌕ search the कोश ⌘Kप्रहर — · —:—:—ours, from sunriseउज्जयिनी —:—:—UTC + λ/15 h, λ = 75.7682° E (D13)IST Error −26.9 minlocal mean time − IST = 4λ − 330 min (K12)engine 3f94072the site ↗

yantra/patha/katapayadi.js

the Kaṭapayādi (कटपयादि) number cipher, dependency-free, exact (BigInt).

151 lines · 0 exports

प्रमाण: पाठ (the Kaṭapayādi rule as the editions state it; Āryabhaṭa's Gītikā words) · गणित
लेख · the header

The header, as the file states it

katapayadi.js — the Kaṭapayādi (कटपयादि) number cipher, dependency-free, exact (BigInt). प्रमाण: पाठ (the Kaṭapayādi rule as the editions state it; Āryabhaṭa's Gītikā words) · गणित Rules (the rule verse commonly attributed to the Sadratnamālā [unverified: no printed witness in this repository; the Pāṇini edition gives only the opening words]: नञावचश्च शून्यानि संख्याः कटपयादयः । मिश्रे तूपान्त्यहल् संख्या न च चिन्त्यो हलस्वरः ॥): • क-वर्ग from क=1 … झ=9, ञ=0; ट-वर्ग ट=1 … ध=9, न=0; प-वर्ग प=1 … म=5; य=1 र=2 ल=3 व=4 श=5 ष=6 स=7 ह=8 (ळ=9 in the southern lists). • न, ञ and a standalone vowel count 0. A vowel sign, anusvāra, visarga, candrabindu carry no value. • In a conjunct (मिश्र) only the LAST consonant (उपान्त्य-हल्) counts: क्ष → ष = 6, ग्य → य = 1. • Numbers are read अङ्कानां वामतो गतिः — the FIRST written syllable is the units digit (decodeWord → `value`). `digitsWritten` is the plain left-to-right string for verses that are meant to be read in writing order (the π verse). Works on Devanagari and on IAST romanisation. Browser: window.Katapayadi; node: module.exports.
आवश्यक · requires

What it loads

nothing

required by
निर्यात · exports

What it exports

पाठ · the verses it cites

SS verses named in the header

none in the registry

नलिका · channels

The channels it runs in

not on a channel
कार्य · the functions

Every function, what it calls, who calls it

9 top-level functions read from the source; the doc line is the comment above each; calls and callers are resolved across the registry’s modules by name. Line numbers are the file’s at engine 3f94072.

nfc(s)lines 42–42
calls nothing in the registry
syllablesDevanagari(text)lines 45–63exported

Devanagari text → [{syllable, digit}] in written order. Non-letters are skipped.

calls nfc
called by syllables
syllablesIAST(text)lines 66–88exported

IAST text → [{syllable, digit}] in written order. Case-insensitive; a trailing virama-less consonant counts.

calls nfc
called by syllables
isDevanagari(text)lines 90–90exported
calls nfc
called by syllables
decodeWord(text)lines 94–100exported

Decode a word/phrase. value = अङ्कानां वामतो गतिः (first syllable = units), as BigInt.

calls syllables
called by nothing in the registry

Encode a non-negative integer as a canonical word (first syllable = units).

calls nothing in the registry
called by nothing in the registry
melakartaNumber(ragaName)lines 114–118exported

The 72-melakarta rule: the first two consonants of the rāga name, read वामतो गतिः.

calls syllables
called by nothing in the registry
decodeAryabhata(word)lines 128–147exported

Decode one word of Āryabhaṭa's letter-numerals written in IAST (BigInt). Throws on a letter outside the code.

calls nfc
called by nothing in the registry