jasi.sim.geo.spherical
Class Arc

java.lang.Object
  extended by jasi.sim.basic.value.AbstractSimValueType
      extended by jasi.sim.basic.value.AbstractComparableObject<T>
          extended by jasi.sim.geo.ComparableGeoObject<Arc>
              extended by jasi.sim.geo.spherical.Arc
All Implemented Interfaces:
ExtendedComparable<Arc>, SimValue, Geometric, java.io.Serializable, java.lang.Comparable<Arc>
Direct Known Subclasses:
Latitude, Longitude

public class Arc
extends ComparableGeoObject<Arc>

Arc length.

See Also:
Serialized Form

Field Summary
static Arc CIRCLE
          Arc length of a full circle.
static Arc HALF_CIRCLE
          Arc length of a half circle.
static Arc RECTANGLE
          Arc length of a half circle.
static Arc ZERO
          Arc length of zero.
 
Fields inherited from interface jasi.sim.geo.Geometric
BEGIN, END, MIDLE
 
Constructor Summary
Arc(Arc a)
          Constructor of an arc.
Arc(double arc)
          Constructor of an arc.
Arc(java.lang.String s)
          Constructor of an arc.
 
Method Summary
static Arc acos(double x)
          Construct an arc by the arc cosine of an angle, in the range of 0.0 through pi.
 Arc add(Arc a)
          Add that arc length to this arc length.
 double amount(Arc a)
          Retrieve the amount of this arc length in units of that arc length.
static Arc asin(double x)
          Construct an arc by the arc sine of an angle, in the range of -pi/2 through pi/2.
 int compareTo(Arc a)
          Compares this object with the specified object for order.
protected  double convert(java.lang.String s)
          Convert that string to an arc value.
 double cos()
          Returns the trigonometric cosine.
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
protected  double fit(double arc)
          Fit that arc length to the interval of a circle.
 int hashCode()
          Returns a hash code value for the object.
 double length()
          Get the length of this arc.
 Arc minus(Arc a)
          Subtract that arc length from this arc length.
 double sin()
          Returns the trigonometric sine.
 Arc times(double f)
          Multiply this arc length by a factor.
static java.lang.String toDegree(Arc a)
          Converts an arc length into degrees, minutes and seconds.
static Arc toRadians(double degrees)
          Converts degrees as double into an arc.
static Arc toRadians(java.lang.String degrees)
          Converts degrees as string into an arc.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class jasi.sim.basic.value.AbstractComparableObject
isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class jasi.sim.basic.value.AbstractSimValueType
getContent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jasi.sim.basic.value.SimValue
getContent
 

Field Detail

ZERO

public static final Arc ZERO
Arc length of zero.


HALF_CIRCLE

public static final Arc HALF_CIRCLE
Arc length of a half circle.


RECTANGLE

public static final Arc RECTANGLE
Arc length of a half circle.


CIRCLE

public static final Arc CIRCLE
Arc length of a full circle.

Constructor Detail

Arc

public Arc(double arc)
Constructor of an arc.

Parameters:
arc - The arc length.

Arc

public Arc(Arc a)
Constructor of an arc.

Parameters:
a - An arc .

Arc

public Arc(java.lang.String s)
Constructor of an arc.

Parameters:
s - The string representation of an arc length.
Method Detail

acos

public static Arc acos(double x)
Construct an arc by the arc cosine of an angle, in the range of 0.0 through pi.

Parameters:
x - The value whose arc cosine is to be returned.
Returns:
The arc.

asin

public static Arc asin(double x)
Construct an arc by the arc sine of an angle, in the range of -pi/2 through pi/2.

Parameters:
x - The value whose arc sine is to be returned.
Returns:
The arc.

toRadians

public static Arc toRadians(double degrees)
Converts degrees as double into an arc.

Parameters:
degrees - The degrees to be converted.
Returns:
The arc.

toRadians

public static Arc toRadians(java.lang.String degrees)
Converts degrees as string into an arc.

Parameters:
degrees - The degrees to be converted.
Returns:
The arc.

toDegree

public static java.lang.String toDegree(Arc a)
Converts an arc length into degrees, minutes and seconds.

Parameters:
a - The arc length to be converted.
Returns:
The degrees, minutes and seconds as string

fit

protected double fit(double arc)
Fit that arc length to the interval of a circle.

Parameters:
arc - That arc length.
Returns:
The re-fitted arc length in the interval (-pi,pi).

convert

protected double convert(java.lang.String s)
Convert that string to an arc value.

Parameters:
s - The string representing an arc.
Returns:
The arc value

length

public final double length()
Get the length of this arc.

Returns:
The arc length of a unit circle.

add

public final Arc add(Arc a)
Add that arc length to this arc length.

Parameters:
a - That arc length.
Returns:
The sum of the arc length.

minus

public final Arc minus(Arc a)
Subtract that arc length from this arc length.

Parameters:
a - That arc length.
Returns:
The difference of the arc lengths.

times

public final Arc times(double f)
Multiply this arc length by a factor.

Parameters:
f - The multiplication factor.
Returns:
The scaled arc length.

amount

public final double amount(Arc a)
Retrieve the amount of this arc length in units of that arc length.

Parameters:
a - That arc length.
Returns:
The amount.

sin

public final double sin()
Returns the trigonometric sine.

Returns:
The sine of this arc.

cos

public final double cos()
Returns the trigonometric cosine.

Returns:
The cosine of this arc.

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hash tables.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
o - That object which is compared with this object.
Returns:
True, if this object is the same as that object.

compareTo

public final int compareTo(Arc a)
Compares this object with the specified object for order. Implementation of Comparable interface.

Specified by:
compareTo in interface java.lang.Comparable<Arc>
Specified by:
compareTo in class AbstractComparableObject<Arc>
Parameters:
a - The arc to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than that object.
See Also:
Comparable.compareTo(Object)