is Point In Rectangle - Android java.lang

Android examples for java.lang:Math Geometry

Description

is Point In Rectangle

Demo Code


//package com.java2s;

public class Main {
    public static boolean isPointInRectangle(float circX, float circY,
            float rectX0, float rectY0, float rectX1, float rectY1) {
        if (circX < rectX0) {
            return false;
        }//from w  w  w.ja va 2s .c o  m
        if (circX > rectX1) {
            return false;
        }
        if (circY < rectY0) {
            return false;
        }
        if (circY > rectY1) {
            return false;
        }
        return true;
    }
}

Related Tutorials