Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## toxi.math.conversion
Class UnitTranslator

    java.lang.Object
      toxi.math.conversion.UnitTranslator

    public class UnitTranslator

extends java.lang.Object

Field Summary
`static double` | `INCH_MM` Number of millimeters per inch
`static double` | `POINT_POSTSCRIPT` Number of points per inch

Constructor Summary
`UnitTranslator()`

Method Summary
`static int` | `millisToPixels(double mm, int dpi)` Converts millimeters into pixels.
`static double` | `millisToPoints(double mm)` Converts millimeters into PostScript points.
`static double` | `pixelsToInch(int pix, int dpi)` Converts pixels into inches.
`static double` | `pixelsToMillis(int pix, int dpi)` Converts pixels into millimeters.
`static double` | `pixelsToPoints(int pix, int dpi)` Converts pixels into points.
`static double` | `pointsToMillis(double pt)` Converts points into millimeters.
`static int` | `pointsToPixels(double pt, int dpi)` Converts points into pixels.
`static double` | `squareInchToMillis(double area)` Converts an area measure in square inch to square millimeters.
`static double` | `squarePointsToInch(double area)` Converts an area measure in points to square inch.
`static double` | `squarePointsToMillis(double area)` Converts an area measure in points to square millimeters.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INCH_MM

    public static final double INCH_MM

  Number of millimeters per inch

  See Also:
    Constant Field Values

### POINT_POSTSCRIPT

    public static final double POINT_POSTSCRIPT

  Number of points per inch

  See Also:
    Constant Field Values

Constructor Detail

### UnitTranslator

    public UnitTranslator()

Method Detail

### millisToPixels

    public static int millisToPixels(double mm,
                                     int dpi)

  Converts millimeters into pixels.

  Parameters:
    `mm` - millimeters
    `dpi` - DPI resolution
  Returns:
    number of pixels

### millisToPoints

    public static double millisToPoints(double mm)

  Converts millimeters into PostScript points.

  Parameters:
    `mm` - millimeters
  Returns:
    number of points

### pixelsToInch

    public static double pixelsToInch(int pix,
                                      int dpi)

  Converts pixels into inches.

  Parameters:
    `pix` - pixels
    `dpi` - DPI resolution to use
  Returns:
    number of inches

### pixelsToMillis

    public static double pixelsToMillis(int pix,
                                        int dpi)

  Converts pixels into millimeters.

  Parameters:
    `pix` - pixels
    `dpi` - DPI resolution
  Returns:
    number of millimeters

### pixelsToPoints

    public static double pixelsToPoints(int pix,
                                        int dpi)

  Converts pixels into points.

  Parameters:
    `pix` - pixels
    `dpi` - DPI resolution
  Returns:
    number of points

### pointsToMillis

    public static double pointsToMillis(double pt)

  Converts points into millimeters.

  Parameters:
    `pt` -
  Returns:
    number of millimeters

### pointsToPixels

    public static int pointsToPixels(double pt,
                                     int dpi)

  Converts points into pixels.

  Parameters:
    `pt` - points
    `dpi` - DPI resolution
  Returns:
    number of pixels

### squareInchToMillis

    public static double squareInchToMillis(double area)

  Converts an area measure in square inch to square millimeters.

  Parameters:
    `area` -
  Returns:
    square mm

### squarePointsToInch

    public static double squarePointsToInch(double area)

  Converts an area measure in points to square inch.

  Parameters:
    `area` -
  Returns:
    square inch

### squarePointsToMillis

    public static double squarePointsToMillis(double area)

  Converts an area measure in points to square millimeters.

  Parameters:
    `area` -
  Returns:
    square mm

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD