public class Angle extends TypedDoubleScalarRel<AngleUnit,Angle>
DoubleScalar<AngleUnit> value = new DoubleScalar<AngleUnit>(100.0, AngleUnit.SI);we can now write:
Angle value = new Angle(100.0, AngleUnit.SI);The compiler will automatically recognize which units belong to which quantity, and whether the quantity type and the unit used are compatible.
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-12-22 04:32:39 +0100 (Tue, 22 Dec 2015) $, @version $Revision: 180 $, by $Author: averbraeck $,
initial version Sep 1, 2015
DoubleScalar.Abs<U extends Unit<U>>, DoubleScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
static Angle |
ZERO
constant with value zero.
|
si| Constructor and Description |
|---|
Angle(Angle value)
Construct Angle scalar.
|
Angle(double value,
AngleUnit unit)
Construct Angle scalar.
|
| Modifier and Type | Method and Description |
|---|---|
Dimensionless |
divideBy(Angle v)
Calculate the division of Angle and Angle, which results in a Dimensionless scalar.
|
protected Direction |
instantiateTypeAbs(double value,
AngleUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
protected Angle |
instantiateTypeRel(double value,
AngleUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Angle |
interpolate(Angle zero,
Angle one,
double ratio)
Interpolate between two values.
|
static Angle |
max(Angle r1,
Angle r2)
Return the maximum value of two relative scalars.
|
static Angle |
max(Angle r1,
Angle r2,
Angle... rn)
Return the maximum value of more than two relative scalars.
|
static Angle |
min(Angle r1,
Angle r2)
Return the minimum value of two relative scalars.
|
static Angle |
min(Angle r1,
Angle r2,
Angle... rn)
Return the minimum value of more than two relative scalars.
|
Direction |
plus(Direction v)
Relative scalar plus Absolute scalar = Absolute scalar.
|
Direction |
toAbs()
Translate the relative scalar into an absolute scalar (e.g., before or after a multiplication or division).
|
abs, ceil, divideBy, floor, minus, multiplyBy, plus, rint, roundcompareTo, eq, ge, getSI, gt, le, lt, minus, ne, plusdivide, divide, doubleValue, equals, floatValue, getInUnit, getInUnit, hashCode, interpolate, interpolate, intValue, longValue, minus, minus, minus, multiply, multiply, plus, plus, plus, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final Angle ZERO
public Angle(double value,
AngleUnit unit)
value - double valueunit - unit for the double valuepublic Angle(Angle value)
value - Scalar from which to construct this instanceprotected final Angle instantiateTypeRel(double value, AngleUnit unit)
instantiateTypeRel in class TypedDoubleScalarRel<AngleUnit,Angle>value - the double valueunit - the unitprotected final Direction instantiateTypeAbs(double value, AngleUnit unit)
value - the double valueunit - the unitpublic static Angle interpolate(Angle zero, Angle one, double ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic final Direction plus(Direction v)
v - the value to addpublic final Direction toAbs()
public static Angle max(Angle r1, Angle r2)
r1 - the first scalarr2 - the second scalarpublic static Angle max(Angle r1, Angle r2, Angle... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static Angle min(Angle r1, Angle r2)
r1 - the first scalarr2 - the second scalarpublic static Angle min(Angle r1, Angle r2, Angle... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic final Dimensionless divideBy(Angle v)
v - Angle scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.