Java tutorial
//package com.java2s; //License from project: Apache License import java.awt.*; public class Main { public static Point getDirectionPoint(double bearing, Point posFrom, int length) { int x = (int) (Math.sin(bearing) * length); int y = (int) (Math.cos(bearing) * length); return new Point(posFrom.x + x, posFrom.y + y); } }