**3.27(几何:点是否在三角形内?)假设一个平面上有一个直角三角形。编写程序,提示用户输入一个点的x坐标和y坐标,然后判断这个点是否在该三角形内。
下面是运行示例:
Enter a point’s x- and y-coordinates: 100.5 25.5
The point is in the triangle
Enter a point’s x- and y-coordinates: 100.5 50.5
The point is not in the triangle
**3.27(Geometry: points in triangle?) Suppose a right triangle is placed in a plane. Write a program that prompts the user to enter a point with x- and y-coordinates and determines whether the point is inside the triangle.
Here are the sample runs:
Enter a point’s x- and y-coordinates: 100.5 25.5
The point is in the triangle
Enter a point’s x- and y-coordinates: 100.5 50.5
The point is not in the triangle
下面是参考答案代码:
import java.util.*;
public class PointInTriangleQuestion27 {
pub