home *** CD-ROM | disk | FTP | other *** search
- Problem 17: Point inside triangle.
-
- When is a point (s,t) inside a triangle with vertices (x1, y1),
- (x2, y2), (x3, y3)?? For this problem, the input will contain 20
- lines containing coordinate pairs:
- three lines with coordinates of three vertices of first triangle
- seven lines, each with coordinates of a point to be tested therein
- three lines with coordinates of three vertices of second triangle
- seven lines, each with coordinates of a point to be tested therein
-
- For example, if the first five lines of input were
- 3 2
- 6 10
- 15 7
- 5 7
- 14 6
- the corresponding output would be
- 5 7 is inside triangle 1
- 14 6 is outside triangle 1
-
- Spacing of the output is not important, but you must have the words
- "is", "inside" or "outside", and "triangle" in your output, just as
- in the example.
-
- The vertices of the triangle, and the test point, are guaranteed to
- be integers.
-
-