JADE v6.1

com.dautelle.physics
Class Scalar

java.lang.Object
  extended byjava.lang.Number
      extended bycom.dautelle.math.numbers.RealtimeNumber
          extended bycom.dautelle.physics.Quantity
              extended bycom.dautelle.physics.Scalar
All Implemented Interfaces:
java.lang.Comparable, Operable, Realtime, Representable, java.io.Serializable

public class Scalar
extends Quantity

This class represents a dimensionless quantity. It contains methods for performing basic numeric operations such as the elementary exponential, logarithm and trigonometric functions.

Version:
4.1, February 10, 2003
Author:
Jean-Marie Dautelle
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.dautelle.physics.Quantity
Quantity.Factory, Quantity.Value
 
Field Summary
static Scalar e
          Holds the natural logarithmic base.
static Scalar ONE
          Represents a Scalar amounting to 1.
static Scalar ZERO
          Represents a Scalar amounting to nothing.
 
Constructor Summary
protected Scalar()
          Default constructor (allows for derivation).
 
Method Summary
 Angle acos()
          Returns an Angle such as its cosine is this Scalar.
 Angle asin()
          Returns an Angle such as its sine is this Scalar.
 Angle atan()
          Returns an Angle such as its tangent is this Scalar.
 Scalar exp()
          Returns the exponential number e raised to the power of this Scalar.
 Scalar log()
          Returns the natural logarithm (base e) of this Scalar.
 Scalar pow(Scalar exp)
          Returns this Scalar raised to the power of the specified Scalar exponent.
static Scalar scalarOf(Quantity quantity)
          Returns the Scalar corresponding to the specified quantity.
static void showAs(Unit unit)
          Shows Scalar instances in the specified unit.
static Scalar valueOf(double amount)
          Returns the Scalar of specified amount.
static Scalar valueOf(double amount, double error)
          Returns the Scalar of specified amount and measurement error.
 
Methods inherited from class com.dautelle.physics.Quantity
abs, add, appendTo, approxEquals, approxEquals, compareTo, divide, divide, doubleValue, doubleValue, equals, floatValue, floatValue, getAbsoluteError, getMaximum, getMinimum, getOutputUnit, getRelativeError, getSystemUnit, hashCode, intValue, intValue, inverse, isPossiblyZero, longValue, longValue, multiply, multiply, negate, opposite, plus, pow, random, reciprocal, root, subtract, times, toString, toString, toXml, valueOf, valueOf, valueOf, valueOf
 
Methods inherited from class com.dautelle.math.numbers.RealtimeNumber
clone, export, isLocalObject, isPoolObject, pow, recycle, toHeap
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Scalar ZERO
Represents a Scalar amounting to nothing.


ONE

public static final Scalar ONE
Represents a Scalar amounting to 1.


e

public static final Scalar e
Holds the natural logarithmic base.

Constructor Detail

Scalar

protected Scalar()
Default constructor (allows for derivation).

Method Detail

scalarOf

public static Scalar scalarOf(Quantity quantity)
Returns the Scalar corresponding to the specified quantity.

Parameters:
quantity - a quantity compatible with Scalar.
Returns:
the specified quantity or a new Scalar instance.
Throws:
ConversionException - if the current model does not allow the specified quantity to be converted to Scalar.

valueOf

public static Scalar valueOf(double amount)
Returns the Scalar of specified amount.

Parameters:
amount - the estimated amount (± 1/2 LSB).
Returns:
the corresponding Scalar.

valueOf

public static Scalar valueOf(double amount,
                             double error)
Returns the Scalar of specified amount and measurement error.

Parameters:
amount - the estimated amount (± error).
error - the measurement error (absolute).
Returns:
the corresponding Scalar.

showAs

public static void showAs(Unit unit)
Shows Scalar instances in the specified unit.

Parameters:
unit - the output unit for Scalar instances.
See Also:
Quantity.getOutputUnit()

exp

public Scalar exp()
Returns the exponential number e raised to the power of this Scalar.

Returns:
exp(this)

log

public Scalar log()
Returns the natural logarithm (base e) of this Scalar.

Returns:
log(this)

pow

public Scalar pow(Scalar exp)
Returns this Scalar raised to the power of the specified Scalar exponent.

Parameters:
exp - the exponent.
Returns:
this**exp

asin

public Angle asin()
Returns an Angle such as its sine is this Scalar.

Returns:
the arc sine of this angle.

acos

public Angle acos()
Returns an Angle such as its cosine is this Scalar.

Returns:
the arc cosine of this angle.

atan

public Angle atan()
Returns an Angle such as its tangent is this Scalar.

Returns:
the arc tangent of this angle

JADE v6.1

Copyright © 2004 Jean-Marie Dautelle.