freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-392-enmeshed-unit-c...

30 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4f41000cf542c510007
title: 问题392陷入困境的单位圆
challengeType: 5
videoUrl: ''
---
# --description--
直线网格是正交网格,其中网格线之间的间距不必是等距的。这种网格的一个例子是对数图纸。
考虑笛卡尔坐标系中的直线网格具有以下属性网格线平行于笛卡尔坐标系的轴。有N + 2个垂直网格线和N + 2个水平网格线。因此存在N + 1xN + 1个矩形单元。两个外部垂直网格线的方程是x = -1且x = 1.两个外部水平网格线的方程是y = -1和y如果它们与单位圆重叠则网格单元为红色否则为黑色。对于这个问题我们希望您找到剩余的N个内部水平线和N个内部垂直网格线的位置以便红色占据的区域细胞最小化。
例如这里是N = 10的解决方案的图片
红色单元占N = 10的区域舍入到小数点后面的10位是3.3469640797。
找到N = 400的位置。将红色单元占用的区域四舍五入到小数点后面的10位数作为答案。
# --hints--
`euler392()`应返回3.1486734435。
```js
assert.strictEqual(euler392(), 3.1486734435);
```
# --solutions--