2018-09-30 23:01:58 +01:00
---
id: 5900f3c71000cf542c50feda
challengeType: 5
title: 'Problem 91: Right triangles with integer coordinates'
2019-08-05 09:17:33 -07:00
forumTopicId: 302208
2018-09-30 23:01:58 +01:00
---
## Description
<section id='description'>
2020-02-08 13:29:10 -05:00
The points P (x1, y1) and Q (x2, y2) are plotted at integer coordinates and are joined to the origin, O(0,0), to form ΔOPQ.
2018-09-30 23:01:58 +01:00
2020-02-08 13:29:10 -05:00
There are exactly fourteen triangles containing a right angle that can be formed when each coordinate lies between 0 and 2 inclusive; that is,0 ≤ x1, y1, x2, y2 ≤ 2.
2018-09-30 23:01:58 +01:00
Given that 0 ≤ x1, y1, x2, y2 ≤ 50, how many right triangles can be formed?
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
2018-10-04 14:37:37 +01:00
tests:
- text: <code>euler91()</code> should return 14234.
2019-07-26 19:48:23 -07:00
testString: assert.strictEqual(euler91(), 14234);
2018-09-30 23:01:58 +01:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler91() {
// Good luck!
return true;
}
euler91();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
2019-07-18 08:24:12 -07:00
2018-09-30 23:01:58 +01:00
</section>