artificialpicasso.mathutils.cosine_law#

artificialpicasso.mathutils.cosine_law(*, a=None, b=None, c=None, C=None)[source]#

Solves a triangle using cosine law.

If given all 3 side lengths of a triangle, returns the angle opposite to side c. If given the lengths of 2 sides of a trianle and the angle opposite to side c, returns the length of the missing side.

Parameters:
  • a (float, optional) – Length of the first side of the triangle. Defaults to None.

  • b (float, optional) – Length of the second side. Defaults to None.

  • c (float, optional) – Length of the third side. Defaults to None.

  • C (float, optional) – The angle opposite to side c (in degrees). Defaults to None.

Returns:

The value of the missing argument

Return type:

float