36 lines
1.7 KiB
Plaintext
36 lines
1.7 KiB
Plaintext
The [https://en.wikipedia.org/wiki/Law_of_cosines Law of cosines] states that for an angle γ, (gamma) of any triangle, if the sides adjacent to the angle are A and B and the side opposite is C; then the lengths of the sides are related by this formula:
|
||
<big> <code>A<sup>2</sup> + B<sup>2</sup> - 2ABcos(γ) = C<sup>2</sup></code> </big>
|
||
|
||
;Specific angles:
|
||
For an angle of of '''90º''' this becomes the more familiar "Pythagoras equation":
|
||
<big> <code>A<sup>2</sup> + B<sup>2</sup> = C<sup>2</sup></code> </big>
|
||
|
||
For an angle of '''60º''' this becomes the less familiar equation:
|
||
<big> <code>A<sup>2</sup> + B<sup>2</sup> - AB = C<sup>2</sup></code> </big>
|
||
|
||
And finally for an angle of '''120º''' this becomes the equation:
|
||
<big> <code>A<sup>2</sup> + B<sup>2</sup> + AB = C<sup>2</sup></code> </big>
|
||
|
||
|
||
;Task:
|
||
* Find all integer solutions (in order) to the three specific cases, distinguishing between each angle being considered.
|
||
* Restrain all sides to the integers '''1..13''' inclusive.
|
||
* Show how many results there are for each of the three angles mentioned above.
|
||
* Display results on this page.
|
||
|
||
|
||
Note: Triangles with the same length sides but different order are to be treated as the same.
|
||
|
||
;Optional Extra credit:
|
||
* How many 60° integer triples are there for sides in the range 1..10_000 ''where the sides are not all of the same length''.
|
||
|
||
|
||
;Related Task
|
||
* [[Pythagorean triples]]
|
||
|
||
|
||
;See also:
|
||
* [https://youtu.be/p-0SOWbzUYI?t=12m11s Visualising Pythagoras: ultimate proofs and crazy contortions] Mathlogger Video
|
||
<br><br>
|
||
|