de.enough.polish.geometry2d
Class Translation2D

java.lang.Object
  extended by de.enough.polish.geometry2d.Translation2D

public class Translation2D
extends Object

Performs translations on 2D geometrical entities (lines, polygons)

Author:
Ovidiu Iliescu

Constructor Summary
Translation2D()
           
 
Method Summary
static void moveTo(Line2D line, Point2D point)
          Moves a Line2D object (with respect to it's origin) to specified point.
static void moveTo(Polygon2D polygon, Point2D point)
          Moves a Polygon2D object (with respect to it's origin) to specified point.
static void translate(Line2D line, double dx, double dy)
          Translate a Line2D object on the X and Y axes.
static void translate(Point2D point, double dx, double dy)
          Translate a Point2D object on the X and Y axes.
static void translate(Polygon2D polygon, double dx, double dy)
          Translate a Polygon2D object on the X and Y axes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Translation2D

public Translation2D()
Method Detail

translate

public static void translate(Point2D point,
                             double dx,
                             double dy)
Translate a Point2D object on the X and Y axes.

Parameters:
point - the point to translate
dx - the X-axis offset
dy - the Y-axis offset

translate

public static void translate(Line2D line,
                             double dx,
                             double dy)
Translate a Line2D object on the X and Y axes.

Parameters:
line - the line to translate
dx - the X-axis offset
dy - the Y-axis offset

translate

public static void translate(Polygon2D polygon,
                             double dx,
                             double dy)
Translate a Polygon2D object on the X and Y axes.

Parameters:
polygon - the polygon to translate
dx - the X-axis offset
dy - the Y-axis offset

moveTo

public static void moveTo(Line2D line,
                          Point2D point)
Moves a Line2D object (with respect to it's origin) to specified point.

Parameters:
line - the line to move
point - the point to move to

moveTo

public static void moveTo(Polygon2D polygon,
                          Point2D point)
Moves a Polygon2D object (with respect to it's origin) to specified point.

Parameters:
polygon - the polygon to move
point - the point to move to