com.partnersoft.geometry.xy
Class XyDirection

java.lang.Object
  extended by com.partnersoft.geometry.xy.XyDirection
All Implemented Interfaces:
Immutable

public class XyDirection
extends java.lang.Object
implements Immutable

An angular direction. (as opposed to XyAngle,

Angles are one of the most problematic parts of a geometry model. There are a number of units of measure, starting angles, and standard directions. We have divided the problem into XyAngle, which deals with angular magnitude and unit conversion, and XyDirection, which deals with angular coordinates and coordinate system conversion.

Having separate angle and direction types also allows more semantic precision. For example, the angle of a line is an XyDirection, but the angle between two lines is just an XyAngle.

No public constructors are provided to minimize errors caused by specifying the wrong coordinate system. This is a bit pedantic but will hopefully prove beneficial in the long run. You may construct an XyDirection using an XyAngle and one of the following factory methods:

or, one of the convenience factory methods: