public class IlvAngularUnit extends IlvUnit
IlvAngularUnit is the radian.
IlvAngularUnit has constants defining usual units:
RADIAN defines radians.
DEGREE defines degrees.
GRAD defines grads.
GetRegisteredUnit method, or listed using the
GetRegisteredUnits method of the superclass,
IlvUnit.
IlvUnit| Modifier and Type | Field and Description |
|---|---|
static IlvAngularUnit |
DEGREE
The unit representing degrees.
|
static IlvAngularUnit |
GRAD
The unit representing grads.
|
static IlvAngularUnit |
RADIAN
The unit representing radians.
|
| Constructor and Description |
|---|
IlvAngularUnit(double radiansPerUnit,
String abbreviation,
String name)
Constructs a new angular unit.
|
IlvAngularUnit(IlvAngularUnit source)
Constructs a new angular unit by copying an existing one.
|
IlvAngularUnit(IlvInputStream stream)
Reads the object from an
IlvInputStream object. |
| Modifier and Type | Method and Description |
|---|---|
IlvUnit |
copy()
Returns a copy of this
IlvAngularUnit. |
boolean |
equivalent(IlvUnit unit)
Returns
true if the specified unit is equivalent to this
one. |
double |
fromDMS(String value)
Converts a string specifying an angle in degrees, minutes,
and seconds to this angular unit.
|
double |
fromKernel(double value)
Converts the value specified in the kernel unit of the quantity measured
by this unit, to values in this unit.
|
double |
fromRadians(double radians)
Converts radians to this unit.
|
double |
getRadiansPerUnit()
Returns the number of radians per unit.
|
String |
toDMS(double angle,
boolean lat)
Converts a double representing an angle expressed in this unit to its
DMS (Degree, Minute, Second) representation.
|
double |
toKernel(double value)
Converts the value specified in the units of this
IlvUnit to
the kernel unit (that is, radians). |
double |
toRadians(double unit)
Converts this unit to radians.
|
void |
write(IlvOutputStream stream)
Writes the object to the specified
IlvOutputStream. |
equals, getAbbreviation, getLocalizedAbbreviation, getLocalizedName, getName, GetRegisteredUnit, GetRegisteredUnits, toStringpublic static final IlvAngularUnit RADIAN
public static final IlvAngularUnit DEGREE
public static final IlvAngularUnit GRAD
public IlvAngularUnit(double radiansPerUnit,
String abbreviation,
String name)
name - The name of the unit.abbreviation - The abbreviation of the unit.radiansPerUnit - The number of radians per unit.public IlvAngularUnit(IlvAngularUnit source)
source - The source unit.public IlvAngularUnit(IlvInputStream stream) throws IlvReadFileException
IlvInputStream object.stream - The input stream.IlvReadFileException - If the format is not correct.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream.write in interface IlvPersistentObjectwrite in class IlvUnitstream - The stream to write this unit to.IOException - If an I/O error occurs.public double getRadiansPerUnit()
public double fromRadians(double radians)
radians - The value to convert, expressed in radians.public double toRadians(double unit)
unit - The value to convert, expressed in this unit.public double toKernel(double value)
IlvUnit to
the kernel unit (that is, radians).public double fromKernel(double value)
fromKernel in class IlvUnitvalue - The value expressed in kernel units.public IlvUnit copy()
IlvAngularUnit.public boolean equivalent(IlvUnit unit)
true if the specified unit is equivalent to this
one.equivalent in class IlvUnitunit - The unit to compare to.true if the two units are equivalent.public String toDMS(double angle, boolean lat)
lat parameter (N or S
if lat is true, E or W otherwise).angle - The value to be converted.lat - true, if the angle is a latitude, and false if the
angle is a longitude.public double fromDMS(String value)
value - The string defining the angle in DMS.value is
null, or the empty string.IllegalArgumentException - If a string format error occurs.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.