Hitomi Formulas in Javascript

Hitomi-Method Dot Position

// verse number starting with 1,
// max 26 words per verse,
// 511 spokes per ring

ring = Math.ceil( verse / 511 );
spoke = ( verse - 1 ) % 511 + 1;

radian = ( spoke - 1 ) * 2*Math.PI / 511;
radius = ( ring - 1 ) * 26 + wordnumber_in_verse - 1;

// x and y need to be added to the center
// and multiplied with a zoom factor

x = Math.sin(radian) * radius;
y = Math.cos(radian) * radius;

Hitomi-Timeline Verse to Year Calculation

// verse number starting with 1,
// years timeline starting at 720 BC

year = -719 + Math.floor( 360 / 511 * ( verse - 1 ) );

// if year is negative, remove sign and account
// for the 'missing' year 0 between 1 BC and 1 AD

if (year <= 0) {
	year -= 1;
	year *= -1;
	era = " BC";
    } else {
	era = " AD";
}