1 package org.djunits.unit.scale;
2
3 import java.io.Serializable;
4
5 /**
6 * Scales for unit conversion, offers functions to and from SI units. E.g., LinearScale for Length, Area, etc. LinearOffsetScale
7 * for Temperature. PercentScale for Angle. LogarithmicScale for Sound.
8 * <p>
9 * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10 * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
11 * </p>
12 * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
13 * initial version Oct 11, 2015 <br>
14 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
15 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
16 */
17 public interface Scale extends Serializable
18 {
19 /**
20 * Convert a value to an SI value using this scale.
21 * @param value double; the value to convert
22 * @return the corresponding SI value
23 */
24 double toStandardUnit(double value);
25
26 /**
27 * Convert a value from an SI value to a value in the unit that uses this scale.
28 * @param value double; the value to convert
29 * @return the corresponding value in the given unit
30 */
31 double fromStandardUnit(double value);
32
33 /**
34 * Return whether this is a base (SI) scale.
35 * @return boolean; whether this is a base (SI) scale or not
36 */
37 boolean isBaseSIScale();
38 }