public class FloatAngle extends AbstractFloatScalarRel<AngleUnit,FloatAngle>
FloatScalar.Rel<AngleUnit> value = new FloatScalar.Rel<AngleUnit>(100.0, AngleUnit.SI);we can now write:
FloatAngle value = new FloatAngle(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-2018 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 FloatAngle |
NaN
constant with value NaN.
|
static FloatAngle |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static FloatAngle |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static FloatAngle |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static FloatAngle |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static FloatAngle |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
FloatAngle(double value,
AngleUnit unit)
Construct FloatAngle scalar using a double value.
|
FloatAngle(FloatAngle value)
Construct FloatAngle scalar.
|
FloatAngle(float value,
AngleUnit unit)
Construct FloatAngle scalar.
|
Modifier and Type | Method and Description |
---|---|
static FloatAngle |
createSI(float value)
Construct FloatAngle scalar.
|
FloatDimensionless |
divideBy(FloatAngle v)
Calculate the division of FloatAngle and FloatAngle, which results in a FloatDimensionless scalar.
|
FloatDirection |
instantiateAbs(float value,
DirectionUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
FloatAngle |
instantiateRel(float value,
AngleUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatAngle |
interpolate(FloatAngle zero,
FloatAngle one,
float ratio)
Interpolate between two values.
|
static FloatAngle |
max(FloatAngle r1,
FloatAngle r2)
Return the maximum value of two relative scalars.
|
static FloatAngle |
max(FloatAngle r1,
FloatAngle r2,
FloatAngle... rn)
Return the maximum value of more than two relative scalars.
|
static FloatAngle |
min(FloatAngle r1,
FloatAngle r2)
Return the minimum value of two relative scalars.
|
static FloatAngle |
min(FloatAngle r1,
FloatAngle r2,
FloatAngle... rn)
Return the minimum value of more than two relative scalars.
|
FloatDirection |
plus(FloatDirection v)
Relative scalar plus Absolute scalar = Absolute scalar.
|
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
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final FloatAngle ZERO
public static final FloatAngle NaN
public static final FloatAngle POSITIVE_INFINITY
public static final FloatAngle NEGATIVE_INFINITY
public static final FloatAngle POS_MAXVALUE
public static final FloatAngle NEG_MAXVALUE
public FloatAngle(float value, AngleUnit unit)
value
- float valueunit
- unit for the float valuepublic FloatAngle(FloatAngle value)
value
- Scalar from which to construct this instancepublic FloatAngle(double value, AngleUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatAngle instantiateRel(float value, AngleUnit unit)
instantiateRel
in class AbstractFloatScalarRel<AngleUnit,FloatAngle>
value
- the float valueunit
- the unitpublic static final FloatAngle createSI(float value)
value
- float value in SI unitspublic final FloatDirection instantiateAbs(float value, DirectionUnit unit)
value
- the float valueunit
- the unitpublic static FloatAngle interpolate(FloatAngle zero, FloatAngle one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic final FloatDirection plus(FloatDirection v)
v
- the value to addpublic static FloatAngle max(FloatAngle r1, FloatAngle r2)
r1
- the first scalarr2
- the second scalarpublic static FloatAngle max(FloatAngle r1, FloatAngle r2, FloatAngle... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatAngle min(FloatAngle r1, FloatAngle r2)
r1
- the first scalarr2
- the second scalarpublic static FloatAngle min(FloatAngle r1, FloatAngle r2, FloatAngle... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final FloatDimensionless divideBy(FloatAngle v)
v
- FloatAngle scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.