Solving equations involving angles and two pairs of parallel lines