Java Geometry Polygon boundingTest(Polygon p, int x, int y, int w, int h)

Here you can find the source of boundingTest(Polygon p, int x, int y, int w, int h)

Description

bounding Test

License

Apache License

Declaration

public static boolean boundingTest(Polygon p, int x, int y, int w, int h) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Polygon;
import java.awt.Rectangle;

public class Main {
    private static Rectangle rect = new Rectangle(0, 0, 0, 0);

    public static boolean boundingTest(Polygon p, int x, int y, int w, int h) {
        rect.setBounds(x, y, w, h);/*ww  w.j  a v  a  2s  .co  m*/
        return p.intersects(rect);
    }
}

Related

  1. inside_polygon(float[] xpts, float[] ypts, double ptx, double pty)
  2. makeArea(Polygon polygon, int steps, int dX, int dY)
  3. polyArea(Polygon target)
  4. regularPolygon(int sides, double x, double y, double width, double height)