FOR centuries it has been a place of mystery and intrigue, its foundation linked to shadowy secret societies or orders of crusading knights.

Outlandish theories surrounding Rosslyn Chapel even claim it as the resting place of the Holy Grail, the Ark of the Covenant or containing proof that Scots visited America a century before Columbus.

Code-breakers have claimed there is a musical score etched into its decorous interior, although the reason remains an enigma, and the author Dan Brown made it centre stage for the finale of his bestseller The Da Vinci Code.

But now a researcher has proposed a new theory about the origins of the chapel, built in Midlothian by the Earl of Caithness William Sinclair in 1456.

And instead of world-class relics or mythical ties to the Knights Templar, the secret is much more down to earth. Yet it could still have landed its creator in deep trouble with the established Church, and possibly cost him his life.

Roslynn Chapel has been recently restored

Writer Jeff Nisbet has suggested that the carved reliefs which adorn Rosslyn's ceiling are in fact a coded reference to the fact the the earth revolves around the sun, an idea which would see people burned at the stake as heretics just two centuries later.

READ MORE: Rosslyn Chapel remains reburied in grounds

He has been studying the chapel for a number years, and brought forth his new theory after noticing connections between various carvings and the shape of the ceiling.

Mr Nisbet said: "While I have published several Rosslyn-related papers over the years, no area of the chapel has tickled my curiosity more than its great five-course vaulted ceiling.

"From the first, I found it difficult to gaze up at the ceiling without wondering what the builder of the chapel, Earl William Sinclair, could have possibly been thinking when he drew up his now-lost blue-print.

"I knew he was thinking something, though, and that it had to be something big."

The ceiling consists of five sections - known as 'courses' - each containing its own style of carving within its borders - described sequentially as daisies, lilies, sunflowers, roses, and stars.

At the pinnacle of the masonry separating the lily and sunflower courses hangs a carved keystone depicting the well-known Sinclair heraldic device, a cross, held between two hands.

Does the cieling hold a code?

Mr Nesbit believes the designs are not random, but represent a message, with the key to decoding it found in pinnacles at the north and south of the chapel which were revealed to be full of honeycombs during restoration work on the chapel, indicating they were possibly purposely-built beehives.

READ MORE: Rosslyn Chapel researcher finds ancient navigating tool​

Using laser scans, the researcher found that the keystone had been placed so that lines drawn from it through the two beehives angled out to the northeast and southeast at precisely 23.5 degrees, the exact angle the earth tilts on its axis in its journey around the sun.

While this knowledge would one day become widespread in the west, it was already known to the ancient Greeks, while the angle itself was correctly calculated by the Islamic scholar Ulugh Beg in Samarkand in 1437s - just two decades before Rosslyn was built.

It is possible that the discovery filtered through to Scotland from knights or pilgrimsd returning from the Holy Land, or through tarde routes between the Middle East and Western Europe.

Mr Nisbet said: "We can here see that William Sinclair encoded a very naturalistic message into his ceiling. He tells us it’s the sun, acting in concert with the tilted Earth and the pollinating insects, that makes things grow, as shown in the four flower-filled courses of the chapel’s ceiling.

"Moreover, since the sun's light passes each day through Rosslyn's arched ceiling of things that grow on Earth, it seems plausible that William was symbolically and correctly recording that our planet, contrary to church dogma, turns once daily on its axis and once annually around the sun.

"This would have been a rather dangerous message to write large in his chapel, high over the heads of the assembled Rosslyn congregation. History tells us that Giordano Bruno, 254 years after Rosslyn’s founding, was burned alive in Rome for professing, among other heresies, his belief in a heliocentric world."

Tom Hanks and Audrey Tatou starrred in the film of Dan Brown's book

The researcher's work is the latest theory to suggest a meaning behind the carvings, which have enthralled scholars for centuries.

It has also been suggested that depictions of maize - a plant only found in America - are also contained among the carvings, while the composer Stuart Mitchell insisted that sculpted cubes inside Rosslyn depict musical notes.

READ MORE: Da Vinci Code sends Rosslyn Chapel's income soaring

Ian Gardner, Director of Rosslyn Chapel Trust, said: "Rosslyn Chapel has attracted, inspired and intrigued visitors for centuries. There are countless interpretations and theories about the building and its ornate carvings - many of which are impossible to prove or disprove - but they add to the intrigue and sense of mystery for visitors.

"We would encourage people to come and visit and make up their own minds about the building."