Package gnu.math
Class Quantity
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
- All Implemented Interfaces:
Serializable
A quantity with a unit.
This generalizes the DSSSL quantity type (to more than lengths).
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()
static Quantity
Return this + k * obj.addReversed
(Numeric x, int k) Calculatex+k&this
.static int
int
Return an integer for which ofthis
orobj
is larger.int
static Quantity
double
The value of the imaginary component, as a double.double
The value of the "j" component, as a double.double
The value of the "k" component, as a double.double
The value of the real component, as a double.im()
The value of the imaginary component, as a RealNum.final double
imValue()
The value of the imaginary component, as a double.jm()
The value of the "j" component, as a RealNum.final double
jmValue()
The value of the "j" component, as a double.km()
The value of the "k" component, as a RealNum.final double
kmValue()
The value of the "k" component, as a double.static Quantity
static Quantity
make
(Quaternion x, Unit u) static Quantity
neg()
abstract Quaternion
number()
re()
The value of the real component, as a RealNum.final double
reValue()
The value of the real component, as a double.static Quantity
toString
(int radix) unit()
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, isExact, isZero, longValue, mul_ident, power, sub, toExact, toInexact, toString
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
Quantity
public Quantity()
-
-
Method Details
-
unit
-
dimensions
-
number
-
re
The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component. -
im
The value of the imaginary component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true imaginary component. -
jm
The value of the "j" component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true "j" component. -
km
The value of the "k" component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true "k" component. -
reValue
public final double reValue()The value of the real component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleValue. -
imValue
public final double imValue()The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleImagValue. -
jmValue
public final double jmValue()The value of the "j" component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleJmagValue. -
kmValue
public final double kmValue()The value of the "k" component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleKmagValue. -
doubleValue
public double doubleValue()The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Specified by:
doubleValue
in classNumber
-
doubleImagValue
public double doubleImagValue()The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in. -
doubleJmagValue
public double doubleJmagValue()The value of the "j" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in. -
doubleKmagValue
public double doubleKmagValue()The value of the "k" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in. -
make
-
make
-
make
-
neg
-
abs
-
compare
-
compare
Description copied from class:Numeric
Return an integer for which ofthis
orobj
is larger. Return 1 ifthis>obj
; 0 ifthis==obj
; -1 ifthis<obj
; -2 ifthis!=obj
otherwise (for example if either is NaN); -3 if not comparable (incompatible types). -
compareReversed
- Overrides:
compareReversed
in classNumeric
-
add
-
add
Description copied from class:Numeric
Return this + k * obj. -
addReversed
Description copied from class:Numeric
Calculatex+k&this
.- Overrides:
addReversed
in classNumeric
-
times
-
mul
-
mulReversed
- Overrides:
mulReversed
in classNumeric
-
divide
-
div
-
divReversed
- Overrides:
divReversed
in classNumeric
-
toString
-