If you know values for two sides and one angle, you add given sides to a square root of the [latex]a[/latex] squared and [latex]b[/latex] squared, minus two times the product of both sides and cosine of a given angle. The formula is [latex]P = a + b + \\sqrt {a² + b² – 2 × a × b × cos(γ)}[/latex]