com.bbn.openmap.omGraphics.util
Class ArcCalc

java.lang.Object
  |
  +--com.bbn.openmap.omGraphics.util.ArcCalc

public class ArcCalc
extends java.lang.Object

A class that calculates an arc between two points, given the point coordinates, and an arc measurement that represents, in radians, the length of the part of the circle that should be represented by the arc.


Field Summary
protected  double arcAngle
          This setting is the amount of an angle, limited to a semi-circle (PI) that the curve will represent.
 java.awt.Point arcCenter
           
protected  OMGraphicList arcGraphics
           
 double arcRadius
           
protected  boolean arcUp
          For x-y and offset lines that have an arc drawn between them, tell which way the arc should be drawn, toward the Equator, or away from it, generally.
 double distance
           
 double endSlope
           
protected  boolean generated
           
 double inverseSlope
           
 java.awt.Point midPoint
           
 java.awt.Point peakPoint
           
protected  boolean reversed
          Set to true if the points for the arc line up from x2, y2 to x1, y1
 double startSlope
           
 double straightLineSlope
           
protected  int[] xpoints
           
protected  int[] ypoints
           
 
Constructor Summary
ArcCalc(double aa, boolean putArcUp)
          Set the arc that is drawn between the points of a x-y or offset line.
 
Method Summary
 void generate(int x1, int y1, int x2, int y2)
          Generate the points that will generate the curved line between two points.
 double getArcAngle()
          Return the arc angle set for this line.
 OMGraphicList getArcGraphics()
           
protected  double getRealAngle(int x1, int y1, int x2, int y2)
          Given the straight line between two points, figure out the angle, in radians, of that line in relation to the coordinate system on the screen.
 boolean getReversed()
           
 int[] getXPoints()
           
 int[] getYPoints()
           
 boolean isArcUp()
          Returns true if the arc direction setting is upward, meaning that the peak of the arc is above (or more so) the line that goes between the two points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arcGraphics

protected OMGraphicList arcGraphics

generated

protected boolean generated

distance

public double distance

straightLineSlope

public double straightLineSlope

inverseSlope

public double inverseSlope

midPoint

public java.awt.Point midPoint

arcCenter

public java.awt.Point arcCenter

peakPoint

public java.awt.Point peakPoint

startSlope

public double startSlope

endSlope

public double endSlope

arcRadius

public double arcRadius

xpoints

protected int[] xpoints

ypoints

protected int[] ypoints

arcAngle

protected double arcAngle
This setting is the amount of an angle, limited to a semi-circle (PI) that the curve will represent. In other words, the arc between the two end points is going to look like a 0 degrees of a circle (straight line, which is the default), or 180 degrees of a circle (full semi-circle). Given in radians, though, not degrees. OK?


arcUp

protected boolean arcUp
For x-y and offset lines that have an arc drawn between them, tell which way the arc should be drawn, toward the Equator, or away from it, generally. Default is true, to make it look like great circle line for northern hemishere lines.


reversed

protected boolean reversed
Set to true if the points for the arc line up from x2, y2 to x1, y1

Constructor Detail

ArcCalc

public ArcCalc(double aa,
               boolean putArcUp)
Set the arc that is drawn between the points of a x-y or offset line. If the arc amount is negative, the arc will be flipped over.

Parameters:
aa - arcAngle, in radians, between 0-PI.
putArcUp - arc peak above points.
Method Detail

getArcAngle

public double getArcAngle()
Return the arc angle set for this line. Will only be set if it was set externally.

Returns:
arc angle in radians.

isArcUp

public boolean isArcUp()
Returns true if the arc direction setting is upward, meaning that the peak of the arc is above (or more so) the line that goes between the two points.


generate

public void generate(int x1,
                     int y1,
                     int x2,
                     int y2)
Generate the points that will generate the curved line between two points. The arcAngle is the number of radians of a circle that the arc should represent. Math.PI is the Max. The setArcAngle should be called before this method is called, so that the method knoes what to create.


getRealAngle

protected double getRealAngle(int x1,
                              int y1,
                              int x2,
                              int y2)
Given the straight line between two points, figure out the angle, in radians, of that line in relation to the coordinate system on the screen. Always returns a positive value, and the angle is from point 1 to point 2.


getXPoints

public int[] getXPoints()

getYPoints

public int[] getYPoints()

getArcGraphics

public OMGraphicList getArcGraphics()

getReversed

public boolean getReversed()


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details