Subtracts one point from another - Android Graphics

Android examples for Graphics:Path Point

Description

Subtracts one point from another

Demo Code


//package com.java2s;

import android.graphics.PointF;

public class Main {
    /**//w ww. j a v a  2s.  co  m
     * Subtracts one point from another
     * @param p1 First point
     * @param p2 Second point
     * @return The difference between p1 and p2 (i.e., p1 - p2)
     */
    public static PointF subtract(PointF p1, PointF p2) {
        return new PointF(p1.x - p2.x, p1.y - p2.y);
    }
}

Related Tutorials