calculate planes from corners