PDF Clown
0.1.2

org.pdfclown.util.math.geom
Class GeomUtils

java.lang.Object
  extended by org.pdfclown.util.math.geom.GeomUtils

public class GeomUtils
extends Object

Geometric utilities.

Since:
0.1.2
Version:
0.1.2, 01/20/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Constructor Summary
GeomUtils()
           
 
Method Summary
static Dimension2D scale(Dimension2D size, Dimension2D limit)
          Gets the size scaled to the specified limit.
static Dimension2D scale(Dimension2D size, double limit)
          Gets the size scaled to the specified limit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeomUtils

public GeomUtils()
Method Detail

scale

public static Dimension2D scale(Dimension2D size,
                                double limit)
Gets the size scaled to the specified limit. In particular, the limit matches the largest dimension and proportionally scales the other one; for example, a limit 300 applied to size Dimension2D(100, 200) returns Dimension2D(150, 300).

Parameters:
size - Size to scale.
limit - Scale limit.
Returns:
Scaled size.

scale

public static Dimension2D scale(Dimension2D size,
                                Dimension2D limit)
Gets the size scaled to the specified limit. In particular, implicit (zero-valued) limit dimensions correspond to proportional dimensions; for example, a limit Dimension2D(0, 300) means 300 high and proportionally wide.

Parameters:
size - Size to scale.
limit - Scale limit.
Returns:
Scaled size.

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.