public class ScaleRatio extends java.lang.Object implements Immutable
The canonical representation uses A:B, where A is the model measure and B is the real measure. Floating-point numbers are used to represent, which may provide unsatisfactorily detailed representations in simple cases.
There are a number of standard notations; we use the colon notation e.g. 1:45 meaning that a foot on the model is equal to 45 feet in reality (or an inch on the model is 45 inches in reality - the units don't matter as long as the same ones are used on both sides).
Convenience methods for converting between various other scale representations are provided.
See http://en.wikipedia.org/wiki/Scale_%28ratio%29 for a longer discussion.
Copyright 2012 Partner Software, Inc.
| Constructor and Description |
|---|
ScaleRatio(Cog state) |
ScaleRatio(double a,
double b) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object nother) |
static ScaleRatio |
forLinearMeasurements(LinearMeasurement aMeasurement,
LinearMeasurement bMeasurement) |
static ScaleRatio |
forQuotient(double quotient) |
static ScaleRatio |
forTerms(double a,
double b) |
double |
getA()
The model dimension quantity.
|
double |
getB()
The original dimension quantity.
|
double |
getQuotient() |
int |
hashCode() |
ScaleRatio |
normalized()
Normalized such that A = 1.0.
|
Cog |
toCog() |
java.lang.String |
toString() |
public ScaleRatio(double a,
double b)
public ScaleRatio(Cog state)
public Cog toCog()
public static ScaleRatio forQuotient(double quotient)
public static ScaleRatio forTerms(double a, double b)
public static ScaleRatio forLinearMeasurements(LinearMeasurement aMeasurement, LinearMeasurement bMeasurement)
public ScaleRatio normalized()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic double getA()
public double getB()
public double getQuotient()