Problem 102
Triangle Containment
Three distinct points are plotted at random on a Cartesian plane, for which
Consider the following two triangles:
It can be verified that triangle
Using triangles.txt (right click and ‘Save Link/Target As…’), a 27K text file containing the co-ordinates of one thousand “random” triangles, find the number of triangles for which the interior contains the origin.
NOTE: The first two examples in the file represent the triangles in the example given above.
包含原点的三角形
在平面直角坐标系中选择三个不同的点,其坐标均满足
考虑如下两个三角形:
可以验证三角形
在文本文件triangles.txt中包含了一千个“随机”三角形的坐标,求其中包含原点在其内部的三角形的数目。
注意:文件中的前两个三角形就是上述样例。
Gitalking ...