------
## 最终结论
```python
import math

def area_polygon(n, s):
    return (1/4) * n * s**2 / math.tan(math.pi / n)

# Test cases
assert area_polygon(4, 20) == 400.00000000000006
assert area_polygon(10, 15) == 1731.1969896610804
assert area_polygon(9, 7) == 302.90938549487214
```