其他分享
首页 > 其他分享> > 点是否在相应的图形内

点是否在相应的图形内

作者:互联网

点是否在圆内


import java.util.*;
import javax.swing.*;  
  class Main {
    public static void main(String[] args){
      Scanner input = new Scanner(System.in);

      System.out.print("Enter a point with two coordinates: ");
      double pointX = input.nextDouble();
      double pointY = input.nextDouble();

      if(Math.pow((pointX * pointX + pointY * pointY) , 0.5) > 10){
        System.out.print("Point (" + pointX + ", " + pointY + ") is not in the circle");
      }else{
        System.out.print("Point (" + pointX + ", " + pointY + ") is in the circle");
      }
        
    }
  }

点是否在矩形内

点是否在三角形内

标签:是否,System,print,input,pointX,pointY,图形,相应,out
来源: https://www.cnblogs.com/doudou-20123/p/16273196.html