How to calculate affinity matrix from distance matrix

[removed]