Java examples for java.lang:Math Geometry
Adds two points.
//package com.java2s; import java.awt.geom.Point2D; public class Main { /**/*from w w w .ja v a 2 s . c o m*/ * Adds two points. * * @param a The first point. * @param b The second point. * @return The resulting point. */ public static Point2D addVec(final Point2D a, final Point2D b) { return new Point2D.Double(a.getX() + b.getX(), a.getY() + b.getY()); } }