Java Rectangle Intersect intersectsRectangle(final double checkMinX, final double checkMinY, final double checkMaxX, final double checkMaxY, final double againstMinX, final double againstMinY, final double againstMaxX, final double againstMaxY)

Here you can find the source of intersectsRectangle(final double checkMinX, final double checkMinY, final double checkMaxX, final double checkMaxY, final double againstMinX, final double againstMinY, final double againstMaxX, final double againstMaxY)

Description

intersects Rectangle

License

Apache License

Declaration

public static boolean intersectsRectangle(final double checkMinX,
            final double checkMinY, final double checkMaxX,
            final double checkMaxY, final double againstMinX,
            final double againstMinY, final double againstMaxX,
            final double againstMaxY) 

Method Source Code

//package com.java2s;
/*/*  ww w  . ja v a  2s  . c om*/
 * Copyright 2016 ANTONIO CARLON
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    public static boolean intersectsRectangle(final double checkMinX,
            final double checkMinY, final double checkMaxX,
            final double checkMaxY, final double againstMinX,
            final double againstMinY, final double againstMaxX,
            final double againstMaxY) {
        boolean output = false;

        if (againstMaxX > checkMinX && againstMinX < checkMaxX
                && againstMaxY > checkMinY && againstMinY < checkMaxY) {
            output = true;
        }
        return output;
    }
}

Related

  1. intersects(Rectangle rect1, Rectangle rect2, boolean vertical)
  2. intersects(Rectangle2D r, Object o)
  3. intersects(Rectangle2D rect1, Rectangle2D rect2)
  4. intersectsOutline(Rectangle2D r, Shape s)
  5. intersectsRectangle(final double checkMinX, final double checkMinY, final double checkMaxX, final double checkMaxY, final double againstMinX, final double againstMinY, final double againstMaxX, final double againstMaxY)