public class FloatAngle extends TypedFloatScalarRel<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-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
FloatScalar.Abs<U extends Unit<U>>, FloatScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
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 |
|---|---|
FloatDimensionless |
divideBy(FloatAngle v)
Calculate the division of FloatAngle and FloatAngle, which results in a FloatDimensionless scalar.
|
protected FloatDirection |
instantiateTypeAbs(float value,
AngleUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
protected FloatAngle |
instantiateTypeRel(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.
|
FloatDirection |
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 FloatAngle ZERO
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 valueprotected final FloatAngle instantiateTypeRel(float value, AngleUnit unit)
instantiateTypeRel in class TypedFloatScalarRel<AngleUnit,FloatAngle>value - the float valueunit - the unitprotected final FloatDirection instantiateTypeAbs(float value, AngleUnit 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 final FloatDirection toAbs()
public 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–2016 Delft University of Technology. All rights reserved.