org.aeonscope.math
Class MeasurementKit

java.lang.Object
  extended by org.aeonscope.math.MeasurementKit

public class MeasurementKit
extends Object

General utilities for dealing with measurements.

Author:
Brooke Kuhlmann

Constructor Summary
MeasurementKit()
           
 
Method Summary
static double center(double secondary, double primary)
          Centers the secondary length relative to the primary length.
static float center(float secondary, float primary)
          Centers the secondary length relative to the primary length.
static int center(int secondary, int primary)
          Centers the secondary length relative to the primary length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementKit

public MeasurementKit()
Method Detail

center

public static int center(int secondary,
                         int primary)
Centers the secondary length relative to the primary length. The result can be negative since it is possible that the secondary length is larger than the primary length.

Example: You have a picture (secondary) that you want to center on a wall (primary).

Parameters:
secondary - The secondary length.
primary - The primary length.
Returns:
The secondary start position relative to the primary length.

center

public static double center(double secondary,
                            double primary)
Centers the secondary length relative to the primary length. Uses the same equation as for centering as found for int values.

Parameters:
secondary - The secondary length.
primary - The primary length.
Returns:
The secondary start position relative to the primary length.
See Also:
center(int, int)

center

public static float center(float secondary,
                           float primary)
Centers the secondary length relative to the primary length. Uses the same equation as for centering as found for int values.

Parameters:
secondary - The secondary length.
primary - The primary length.
Returns:
The secondary start position relative to the primary length.
See Also:
center(int, int)