I simply converted the formula to Scratch... The formula was discovered in the 6th century by a Hindu mathematician, credit to him...