Java examples for 2D Graphics:Point
get Vector from Point2D
//package com.java2s; import java.awt.geom.Point2D; public class Main { /**//from ww w. j a va 2s. c o m * @param source * @param listener * @return */ public static Point2D getVector(Point2D source, Point2D listener) { return new Point2D.Double(source.getX() - listener.getX(), source.getY() - listener.getY()); } }