有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java我需要找到几何图形(三角形和矩形)的重合边

我有一门三角形和矩形的课。每个图形都由代表坐标的整数定义。 三角形有三个顶点a、b和c。 在类三角形中,我有int ax=。。。,int ay=。。。int bx=。。。等等 在矩形类中,我有int-ulx(意思是向上的leftX)、int-bry(右下)等等。矩形:4个顶点,表示8个整数(6个三角形)。 然后我有一个ArrayList三角形和ArrayList矩形。 如何确定两个数字的边是否重合

这是我的三角班

public class Triangle {

    String name;
    int ax;
    int ay;
    int bx;
    int by;
    int cx;
    int cy;

    public Triangolo (String name, int ax, int ay, int bx, int by, int cx, int cy) {

        this.name=name;
        this.ax=ax;
        this.ay=ay;
        this.bx=bx;
        this.by=by;
        this.cx=cx;
        this.cy=cy;
    }


}

共 (0) 个答案