freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-184-triangles-conta...

64 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: 5900f4241000cf542c50ff37
challengeType: 5
title: 'Problem 184: Triangles containing the origin'
forumTopicId: 301820
---
## Description
<section id='description'>
Consider the set Ir of points (x,y) with integer coordinates in the interior of the circle with radius r, centered at the origin, i.e. x2 + y2 < r2.
For a radius of 2, I2 contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in I2 which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
For a radius of 3, there are 360 triangles containing the origin in the interior and having all vertices in I3 and for I5 the number is 10600.
How many triangles are there containing the origin in the interior and having all three vertices in I105?
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler184()</code> should return 1725323624056.
testString: assert.strictEqual(euler184(), 1725323624056);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler184() {
return true;
}
euler184();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>