代码我就不写了,说一下思路,用这4个点构造一个多边形
Polygon(int[] xpoints, int[] ypoints, int npoints)
Constructs and initializes a Polygon from the specified parameters
生成多边形实例后可以直接调用如下方法,专门用来判断是否包含一个点,方法如下
contains(Point p)
Determines whether the specified Point is inside this Polygon
Polygon位于java.awt.*包中
明白了吧?
Polygon(int[] xpoints, int[] ypoints, int npoints)
Constructs and initializes a Polygon from the specified parameters
生成多边形实例后可以直接调用如下方法,专门用来判断是否包含一个点,方法如下
contains(Point p)
Determines whether the specified Point is inside this Polygon
Polygon位于java.awt.*包中
明白了吧?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货