is In Circle - Android java.lang

Android examples for java.lang:Math

Description

is In Circle

Demo Code


import android.graphics.PointF;

public class Main{
    public static boolean isInCircle(PointF center, PointF point,
            float radius) {
        return (square(point.x - center.x)
                + MathUtils.square(point.y - center.y) < MathUtils
                    .square(radius));/*from   www.j a  va2s .  co m*/
    }
    public static float square(float value) {
        return value * value;
    }
}

Related Tutorials