I have a task where i input x and y coordinates and it tells me if it's gray or white, i can't post a picture of the graph but entering most of the coordinates is accurate, but whenever i enter x=1 and y=1 or x=0 y=0 it shows gray even though it's completely white, i want to understand why it's not showing white. I think i have entered all the formulas correctly, there's a gray circle, gray triangle and a white cube in the middle of the triangle
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("241RDB125"); System.out.println("16. variants"); double x, y; System.out.print("x = "); x = sc.nextDouble(); System.out.print("y = "); y = sc.nextDouble(); System.out.println("Result:"); boolean white1 = (x >= 6 && x <= 7 && y >= 4 && y <= 5); boolean grey1 = ((x - 3) * (x - 3) + (y - 3) * (y - 3) >= 4); boolean grey2 = (y <= 7 && x <= 8 && y <= x + 1); if (white1) { System.out.println("white"); } else if (grey1 || grey2) { System.out.println("grey"); } else { System.out.println("white"); } sc.close(); } }