scenic.path
Class ArcSegment

java.lang.Object
  extended by scenic.path.CurvedSegment
      extended by scenic.path.ArcSegment
All Implemented Interfaces:
Segment

public class ArcSegment
extends CurvedSegment

This class defines an elliptical arc. This class does not define the start point of the arc. The start point is the end point of the previous segment.


Constructor Summary
ArcSegment(double xRadius, double yRadius, double rotation, double startAngle, double stopAngle)
          Creates an elliptic arc segment with the given parameters.
 
Method Summary
 java.awt.geom.Point2D.Double calcPoint(double t, java.awt.geom.Point2D.Double position)
          Calculates the position of the segment at the given t value.
 java.awt.geom.Point2D.Double calcRelativePoint(double t)
          Calculates the point along the arc, when the center of the ellipse is thought to be at (0, 0).
 void getBounds(java.awt.geom.AffineTransform transform, java.awt.Rectangle r, java.awt.geom.Point2D.Double position)
          Gets the bounds of this segment using the given transform.
 double getRotation()
          Gets the rotation of the ellipse in degrees.
 double getStartAngle()
          Gets the start angle of the arc in degrees.
 double getStopAngle()
          Gets the stop angle of the arc in degrees.
 double getXRadius()
          Gets the x radius of the ellipse.
 double getYRadius()
          Gets the y radius of the ellipse.
 
Methods inherited from class scenic.path.CurvedSegment
walk
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcSegment

public ArcSegment(double xRadius,
                  double yRadius,
                  double rotation,
                  double startAngle,
                  double stopAngle)
Creates an elliptic arc segment with the given parameters.

Parameters:
xRadius - x radius of the ellipse.
yRadius - y radius of the ellipse.
rotation - rotation of the ellipse in degrees.
startAngle - start angle of the arc in degrees.
stopAngle - stop angle of the arc in degrees.
Method Detail

getXRadius

public double getXRadius()
Gets the x radius of the ellipse.


getYRadius

public double getYRadius()
Gets the y radius of the ellipse.


getRotation

public double getRotation()
Gets the rotation of the ellipse in degrees.


getStartAngle

public double getStartAngle()
Gets the start angle of the arc in degrees.


getStopAngle

public double getStopAngle()
Gets the stop angle of the arc in degrees.


calcPoint

public java.awt.geom.Point2D.Double calcPoint(double t,
                                              java.awt.geom.Point2D.Double position)
Description copied from class: CurvedSegment
Calculates the position of the segment at the given t value.

Specified by:
calcPoint in class CurvedSegment
Parameters:
t - the t value (must be in the range [0, 1]).
position - the previous position.
Returns:
the position.

calcRelativePoint

public java.awt.geom.Point2D.Double calcRelativePoint(double t)
Calculates the point along the arc, when the center of the ellipse is thought to be at (0, 0).

Parameters:
t - the place along the arc (must be inside the rangle [0, 1]).
Returns:
the point.

getBounds

public void getBounds(java.awt.geom.AffineTransform transform,
                      java.awt.Rectangle r,
                      java.awt.geom.Point2D.Double position)
Description copied from interface: Segment
Gets the bounds of this segment using the given transform.

Parameters:
transform - the transform
r - the bounds.
position - the start position.