com.tensegrity.graphics
Class CoordinateOperations

java.lang.Object
  extended bycom.tensegrity.graphics.CoordinateOperations

public class CoordinateOperations
extends java.lang.Object

The CoordinateOperations class provides some functionalities that represent basic operations on coordinates.

Version:
$Id: CoordinateOperations.java,v 1.9 2005/04/01 15:42:39 MichaelKegel Exp $
Author:
MichaelKegel

Method Summary
static Boundary computeBoundingBox2D(Coordinate[] coordinates)
          Static method that computes the 2d boundary of all coordinates in the given coordinate array.
static Coordinate difference(Coordinate a, Coordinate b)
          Static helper method that computes the difference between two Coordinates.
static Coordinate transform_createnew(Transform2D xform, Coordinate coordinate)
          Transforms the Coordinate given by coordinate with the Transform2D given by xform.
static Coordinate[] transform_createnew(Transform2D xform, Coordinate[] coordinates)
          Transforms the Coordinates given by coordinates with the Transform2D given by xform.
static void transform(Transform2D[] xform, Coordinate coordinate)
           
static void transform(Transform2D xform, Coordinate coordinate)
          Transforms the Coordinate given by coordinate with the Transform2D given by xform.
static void transform(Transform2D xform, Coordinate[] coordinates)
          Transforms the Coordinates given by coordinates with the Transform2D given by xform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transform

public static final void transform(Transform2D xform,
                                   Coordinate coordinate)
Transforms the Coordinate given by coordinate with the Transform2D given by xform. The resulting coordinate is stored in the Coordinate given by coordinate.
Note: None of the given arguments may be null.

Parameters:
xform - the Transform2D to transform the given Coordinate with
coordinate - the Coordinate to transform with the given Transform2D

transform

public static final void transform(Transform2D[] xform,
                                   Coordinate coordinate)

transform_createnew

public static final Coordinate transform_createnew(Transform2D xform,
                                                   Coordinate coordinate)
Transforms the Coordinate given by coordinate with the Transform2D given by xform. The resulting coordinate is returned as a new Coordinate.
Note: None of the given arguments may be null.

Parameters:
xform - the Transform2D to transform the given Coordinate with
coordinate - the Coordinate to transform with the given Transform2D
Returns:
Coordinate the resulting Coordinate

transform

public static final void transform(Transform2D xform,
                                   Coordinate[] coordinates)
Transforms the Coordinates given by coordinates with the Transform2D given by xform. The resulting coordinates are stored in the Coordinate array given by coordinates.
Note: None of the given arguments may be null.

Parameters:
xform - the Transform2D to transform the given Coordinate with
coordinates - the Coordinate array to transform with the given Transform2D

transform_createnew

public static final Coordinate[] transform_createnew(Transform2D xform,
                                                     Coordinate[] coordinates)
Transforms the Coordinates given by coordinates with the Transform2D given by xform. The resulting coordinates are returned as a new Coordinate array.
Note: None of the given arguments may be null.

Parameters:
xform - the Transform2D to transform the given Coordinate with
coordinates - the Coordinate array to transform with the given Transform2D
Returns:
Coordinate[] the resulting Coordinates

difference

public static final Coordinate difference(Coordinate a,
                                          Coordinate b)
Static helper method that computes the difference between two Coordinates. The two given Coordinates must have the same number of components.

Parameters:
a - the first coordinate.
b - the second coordinate.
Returns:
the difference of the coordinates.

computeBoundingBox2D

public static final Boundary computeBoundingBox2D(Coordinate[] coordinates)
Static method that computes the 2d boundary of all coordinates in the given coordinate array.

Parameters:
coordinates - the array to compute the boundingbox for.
Returns:
the bounding box of the given array.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.