- sage: S_perp = S.linear_subspace().complement()
- sage: A = S_perp.matrix().transpose()
- sage: proj = A * (A.transpose()*A).inverse() * A.transpose()
- sage: expected = Cone([ proj*g for g in K ], K.lattice())
- sage: P.is_equivalent(expected)
+ sage: A = S.linear_subspace().complement().matrix()
+ sage: proj_S_perp = A.transpose() * (A*A.transpose()).inverse() * A
+ sage: expected_P = Cone([ proj_S_perp*g for g in K ], K.lattice())
+ sage: P.is_equivalent(expected_P)
+ True
+ sage: A = S.linear_subspace().matrix()
+ sage: proj_S = A.transpose() * (A*A.transpose()).inverse() * A
+ sage: expected_S = Cone([ proj_S*g for g in K ], K.lattice())
+ sage: S.is_equivalent(expected_S)