Haidao Suanjing was written by the Chinese mathematician Liu Hui of the Three Kingdoms era as an extension of chapter 9 of The Nine Chapters on the Mathematical Art.