Package jahuwaldt.js.param
Class Coordinate3D<Q extends javax.measure.quantity.Quantity>
- java.lang.Object
-
- org.jscience.mathematics.vector.Vector<Parameter<Q>>
-
- jahuwaldt.js.param.AbstractParamVector<Q,Coordinate3D<Q>>
-
- jahuwaldt.js.param.Coordinate3D<Q>
-
- Type Parameters:
Q
- The Quantity (unit type, such as Length or Volume) of this parameter.
- All Implemented Interfaces:
java.lang.Comparable<javax.measure.Measurable<Q>>
,javax.measure.Measurable<Q>
,javolution.lang.Immutable
,javolution.lang.Realtime
,javolution.lang.ValueType
,GroupAdditive<Vector<Parameter<Q>>>
,Structure<Vector<Parameter<Q>>>
,VectorSpace<Vector<Parameter<Q>>,Parameter<Q>>
,VectorSpaceNormed<Vector<Parameter<Q>>,Parameter<Q>>
- Direct Known Subclasses:
Cylindrical3D
,Polar3D
,Vector3D
public abstract class Coordinate3D<Q extends javax.measure.quantity.Quantity> extends AbstractParamVector<Q,Coordinate3D<Q>> implements javolution.lang.ValueType
This class represents a 3 element vector ofParameter
elements representing a geometrical coordinate.Modified by: Joseph A. Huwaldt
- Version:
- November 4, 2015
- Author:
- Joseph A. Huwaldt, Date: November 21, 2008
-
-
Constructor Summary
Constructors Constructor Description Coordinate3D()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R extends javax.measure.quantity.Quantity>
Coordinate3D<R>asType(java.lang.Class<R> type)
Casts this Coordinate3D to a parameterized unit of specified nature or throw aClassCastException
if the dimension of the specified quantity and this parameter's unit dimension do not match.int
getDimension()
Returns the number of elements held by this vector.boolean
isApproxEqual(Coordinate3D<?> obj)
Compares this Coordinate3D against the specified Coordinate3D for approximate equality (a Coordinate3D object with Vector3D values equal to this one to within the numerical roundoff tolerance).boolean
isApproxZero()
Compares this Coordinate3D for approximate equality to zero (all the values are within the numerical roundoff error of zero).abstract Coordinate3D<javax.measure.quantity.Dimensionless>
toUnitVector()
Returns this vector converted to a unit vector with a vector magnitude of 1.0.-
Methods inherited from class jahuwaldt.js.param.AbstractParamVector
angle, compareTo, divide, dot, doubleValue, fromVector3D, getUnit, getValue, longValue, mag, magValue, minus, norm, normValue, plus, times, to, toArray, toArray, toVector3D
-
Methods inherited from class org.jscience.mathematics.vector.Vector
copy, cross, equals, equals, get, hashCode, minus, opposite, plus, times, times, toString, toText
-
Methods inherited from interface org.jscience.mathematics.structure.GroupAdditive
opposite, plus
-
Methods inherited from interface org.jscience.mathematics.structure.VectorSpace
times
-
-
-
-
Constructor Detail
-
Coordinate3D
public Coordinate3D()
-
-
Method Detail
-
getDimension
public int getDimension()
Returns the number of elements held by this vector. This implementation always returns a value of 3.- Specified by:
getDimension
in classVector<Parameter<Q extends javax.measure.quantity.Quantity>>
- Returns:
- this vector dimension.
-
isApproxEqual
public boolean isApproxEqual(Coordinate3D<?> obj)
Compares this Coordinate3D against the specified Coordinate3D for approximate equality (a Coordinate3D object with Vector3D values equal to this one to within the numerical roundoff tolerance).- Parameters:
obj
- the Coordinate3D object to compare with.- Returns:
true
if this Coordinate3D is approximately identical to that Coordinate3D;false
otherwise.
-
isApproxZero
public boolean isApproxZero()
Compares this Coordinate3D for approximate equality to zero (all the values are within the numerical roundoff error of zero).- Returns:
true
if this Coordinate3D is approximately equal to zero;false
otherwise.
-
asType
public abstract <R extends javax.measure.quantity.Quantity> Coordinate3D<R> asType(java.lang.Class<R> type) throws java.lang.ClassCastException
Casts this Coordinate3D to a parameterized unit of specified nature or throw aClassCastException
if the dimension of the specified quantity and this parameter's unit dimension do not match.- Type Parameters:
R
- The Quantity (unit type) to cast this parameter as.- Parameters:
type
- the quantity class identifying the nature of the unit.- Returns:
- this AbstractParamVector parameterized with the specified type.
- Throws:
java.lang.ClassCastException
- if the dimension of this parameter's unit is different from the specified quantity dimension.java.lang.UnsupportedOperationException
- if the specified quantity class does not have a public static field named "UNIT" holding the standard unit for the quantity.
-
toUnitVector
public abstract Coordinate3D<javax.measure.quantity.Dimensionless> toUnitVector()
Returns this vector converted to a unit vector with a vector magnitude of 1.0.- Returns:
- this vector converted to a unit vector
-
-