|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.geometry.xy.XyDirection
public class XyDirection
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:forBearingDegrees(double)
forBearingRadians(double)
forThetaDegrees(double)
forThetaRadians(double)
Copyright 2007 Partner Software, Inc.
| Method Summary | |
|---|---|
XyAngle |
acuteAngleFrom(XyDirection nother)
Returns the smallest circular angle formed by this direction and the one given. |
boolean |
equals(java.lang.Object nother)
|
static XyDirection |
forBearing(XyAngle bearing)
Create an XyDirection as an bearing angle measured clockwise from north (positive Y axis). |
static XyDirection |
forBearingDegrees(double degrees)
Convenience method equivalent to forBearing(XyAngle.forDegrees(degrees)). |
static XyDirection |
forBearingRadians(double radians)
Convenience method equivalent to forBearing(XyAngle.forRadians(radians)). |
static XyDirection |
forLine(XyPoint start,
XyPoint end)
Factory method for creating a direction from a pair of points. |
static XyDirection |
forTheta(XyAngle theta)
Create an XyDirection as a Cartesian angle measured counter-clockwise from east (positive X axis). |
static XyDirection |
forThetaDegrees(double degrees)
Convenience method equivalent to forTheta(XyAngle.forDegrees(degrees)). |
static XyDirection |
forThetaRadians(double radians)
Convenience method equivalent to forTheta(XyAngle.forRadians(radians)). |
XyAngle |
getBearing()
Returns the bearing angle, measured clockwise from "north" (the positive y axis). |
double |
getBearingDegrees()
Convenience method equivalent to getBearing().getDegrees(). |
double |
getBearingRadians()
Convenience method equivalent to getBearing().getRadians(). |
XyAngle |
getTheta()
Returns the Cartesian angle, measured clockwise from "north" (the positive y axis). |
double |
getThetaDegrees()
Convenience method equivalent to getTheta().getDegrees(). |
double |
getThetaRadians()
Convenience method equivalent to getTheta().getRadians(). |
XyAngle |
obtuseAngleFrom(XyDirection nother)
Returns the largest circular angle formed by this direction and the one given. |
XyDirection |
reversed()
Returns the reverse of this direction by rotating it 180 degrees (pi radians). |
XyDirection |
rotatedBy(XyRotation rotation)
Uses the given rotation to rotate the direction the given amount and direction. |
XyRotation |
rotationFrom(XyDirection nother)
Returns the rotation required to convert the given direction to this one. |
java.lang.String |
toString()
|
XyVector |
toUnitVector()
Converts the direction to a vector of length 1. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static XyDirection forBearing(XyAngle bearing)
public static XyDirection forTheta(XyAngle theta)
public static XyDirection forBearingDegrees(double degrees)
public static XyDirection forBearingRadians(double radians)
public static XyDirection forThetaDegrees(double degrees)
public static XyDirection forThetaRadians(double radians)
public static XyDirection forLine(XyPoint start, XyPoint end)
public XyDirection rotatedBy(XyRotation rotation)
public XyDirection reversed()
public XyRotation rotationFrom(XyDirection nother)
public XyAngle acuteAngleFrom(XyDirection nother)
public XyAngle obtuseAngleFrom(XyDirection nother)
public XyVector toUnitVector()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic XyAngle getBearing()
public XyAngle getTheta()
public double getBearingDegrees()
public double getBearingRadians()
public double getThetaDegrees()
public double getThetaRadians()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||