⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rectangle.java

📁 用于简单的图形的程序
💻 JAVA
字号:
import java.util.Scanner;
public class rectangle extends graph{
	rectangle() {
		System.out
				.println("Please input offset about x & y:(notice: 前三点需构成邻边)");
		Scanner in1 = new Scanner(System.in);
		Scanner in2 = new Scanner(System.in);
		Scanner in3 = new Scanner(System.in);
		Scanner in4 = new Scanner(System.in);
		Scanner in5 = new Scanner(System.in);
		Scanner in6 = new Scanner(System.in);
		Scanner in7 = new Scanner(System.in);
		Scanner in8 = new Scanner(System.in);
		double x, y, x1, y1, x2, y2,x3,y3;
		x = in1.nextDouble();
		y = in2.nextDouble();
		x1 = in3.nextDouble();
		y1 = in4.nextDouble();
		x2 = in5.nextDouble();
		y2 = in6.nextDouble();
		x3 = in7.nextDouble();
		y3 = in8.nextDouble();
		System.out.println("construct completed");
		System.out.println("This rectangle info is:");
		this.x0 = 1 / 4 * (x + x1 + x2+x3);
		this.y0 = 1 / 4 * (y + y1 + y2+y3);
		System.out.print("Area is: ");
		mularea s = new mularea();
		double l, h;
		l=Math.hypot(x-x1, y-y1);
		h=Math.hypot(x1-x2, y1-y2);
		mularea s1=new mularea();
		System.out.println(s.area(l, h));
		System.out.print("Girth is: ");
		mulgirth c1 = new mulgirth();
		System.out.println(c1.girth(h,l));
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -