FileDocCategorySizeDatePackage
PointF.javaAPI DocAndroid 1.5 API2012Wed May 06 22:42:00 BST 2009android.graphics

PointF

public class PointF extends Object
PointF holds two float coordinates

Fields Summary
public float
x
public float
y
Constructors Summary
public PointF()

public PointF(float x, float y)

        this.x = x;
        this.y = y; 
    
public PointF(Point p)

 
        this.x = p.x;
        this.y = p.y;
    
Methods Summary
public final booleanequals(float x, float y)
Returns true if the point's coordinates equal (x,y)

 
        return this.x == x && this.y == y; 
    
public static floatlength(float x, float y)
Returns the euclidian distance from (0,0) to (x,y)

        return FloatMath.sqrt(x * x + y * y);
    
public final floatlength()
Return the euclidian distance from (0,0) to the point

 
        return length(x, y); 
    
public final voidnegate()

 
        x = -x;
        y = -y; 
    
public final voidoffset(float dx, float dy)

        x += dx;
        y += dy;
    
public final voidset(float x, float y)
Set the point's x and y coordinates

        this.x = x;
        this.y = y;
    
public final voidset(android.graphics.PointF p)
Set the point's x and y coordinates to the coordinates of p

 
        this.x = p.x;
        this.y = p.y;