public class Angle extends AbstractDoubleScalarRel<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-2019 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
Modifier and Type | Field and Description |
---|---|
static Angle |
NaN
constant with value NaN.
|
static Angle |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Angle |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Angle |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Angle |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Angle |
ZERO
constant with value zero.
|
si
NUMBER_PATTERN
Constructor and Description |
---|
Angle(Angle value)
Construct Angle scalar.
|
Angle(double value,
AngleUnit unit)
Construct Angle scalar.
|
Modifier and Type | Method and Description |
---|---|
static Angle |
createSI(double value)
Construct Angle scalar.
|
Dimensionless |
divideBy(Angle v)
Calculate the division of Angle and Angle, which results in a Dimensionless scalar.
|
Direction |
instantiateAbs(double value,
DirectionUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
Angle |
instantiateRel(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.
|
static Angle |
valueOf(String text)
Returns a Angle representation of a textual representation of a value with a unit.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, plus, rint, round
compareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toString
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final Angle ZERO
public static final Angle NaN
public static final Angle POSITIVE_INFINITY
public static final Angle NEGATIVE_INFINITY
public static final Angle POS_MAXVALUE
public static final Angle NEG_MAXVALUE
public Angle(double value, AngleUnit unit)
value
- double valueunit
- unit for the double valuepublic Angle(Angle value)
value
- Scalar from which to construct this instancepublic final Angle instantiateRel(double value, AngleUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<AngleUnit,Angle>
value
- double; the double valueunit
- U; the unitpublic final Direction instantiateAbs(double value, DirectionUnit unit)
value
- the double valueunit
- the unitpublic static final Angle createSI(double value)
value
- double value in SI unitspublic 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 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 static Angle valueOf(String text) throws IllegalArgumentException
text
- String; the textual representation to parse into a AngleIllegalArgumentException
- when the text cannot be parsedpublic final Dimensionless divideBy(Angle v)
v
- Angle scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.