In convex quadrilateral $ABCD$, $\angle A = \angle C$, $AB=CD=180$, and $AD \ne BC$.  The perimeter of $ABCD$ is 640. Find $\cos A$.
In $\triangle ABD$, we have $BD^2=a^2+180^2-2(a)(180)\cos A$. In $\triangle BCD$, we have $BD^2=b^2+180^2-2(b)(180)\cos A$. So, $a^2+180^2-2(a)(180)\cos A=b^2+180^2-2(b)(180)\cos A$. Now, we can cancel out $180^2$ from both sides. So, $a^2-2(a)(180)\cos A=b^2-2(b)(180)\cos A$. Let's subtract $a^2$ from both sides. So, we get $-2(a)(180)\cos A=-2(b)(180)\cos A-a^2+b^2$. We can simplify to $-2(a)(180)\cos A=-2(b)(180)\cos A-(a+b)(a-b)$. We know that $a+b=280$. Let's substitute that in. So, we get $-2(a)(180)\cos A=-2(b)(180)\cos A-280(a-b)$. So, $\cos A=\frac{280}{360}$. $\cos A=\frac{7}{9}$. So, the answer is $\frac{7}{9}$.

