Example usage for android.graphics PointF length

List of usage examples for android.graphics PointF length

Introduction

In this page you can find the example usage for android.graphics PointF length.

Prototype

public static float length(float x, float y) 

Source Link

Document

Returns the euclidian distance from (0,0) to (x,y)

Usage

From source file:Main.java

public static float distanceBetween2Points(float x1, float y1, float x2, float y2) {

    return PointF.length(Math.abs(x1 - x2), Math.abs(y1 - y2));
}

From source file:org.mozilla.gecko.gfx.PointUtils.java

/** Computes the scalar distance between two points. */
public static float distance(PointF one, PointF two) {
    return PointF.length(one.x - two.x, one.y - two.y);
}