Brahmagupta matrix