Java examples for 2D Graphics:Dimension
polar Pointing
//package com.java2s; import java.awt.Point; public class Main { public static Point polarPointing(final Point startPoint, int dir, int len) { final Point endPoint = startPoint.getLocation(); double sinDir = Math.sin(Math.toRadians(dir)); double cosDir = Math.cos(Math.toRadians(dir)); Double dx = new Double(len * sinDir); Double dy = new Double(len * cosDir); endPoint.translate(dx.intValue(), dy.intValue()); return endPoint; }/* w w w. ja v a2s .com*/ }