Adds two points together - Android Graphics

Android examples for Graphics:Path Point

Description

Adds two points together

Demo Code


//package com.java2s;

import android.graphics.PointF;

public class Main {
    /**/*from  w  w  w .j av  a2s  . co m*/
     * Adds two points together
     * @param p1 First point
     * @param p2 Second point
     * @return The sum of p1 and p2
     */
    public static PointF add(PointF p1, PointF p2) {
        return new PointF(p1.x + p2.x, p1.y + p2.y);
    }
}

Related Tutorials