/*
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.Scanner;
publicclass PointInRightAngleTriangle {
publicstaticvoidmain(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter a point's x- and y-coordinates: ");
double x1 = input.nextDouble();
double y1 = input.nextDouble();
double x = 200, y = 100;
double maxDistance = Math.sqrt(x * x + y * y) / 2;
double distance = Math.sqrt(x1 * x1 + y1 * y1);
if (distance <= maxDistance)
System.out.println("The point is in the triangle.");
else
System.out.println("The point is not in the triangle.");
}
}