variance of a portfolio with n assets

how to calculate setback distance