ChartCat 1.2

li.netcat.chart.util
Class PolarConverter

java.lang.Object
  extended byli.netcat.chart.util.PolarConverter

public class PolarConverter
extends java.lang.Object

Utility class for polar coordinate calculation.

Author:
Arthur Marxer

Field Summary
static int NET
          Equal to ChartConstants.NET
static int RING
          Equal to ChartConstants.RING
 
Constructor Summary
PolarConverter(ScaleModel tangentialScaleModel, int orientation, float innerRadius)
          Constructs a new PolarConverter that uses the given scale model as the tangential scale model.
 
Method Summary
 float convertX(float tangentialPosition, float radialPosition)
          Returns the x-coordinate of a point.
 float convertY(float tangentialPosition, float radialPosition)
          Returns the y-coordinate of a point.
 double getAngle(float tangentialPosition)
          Returns the angle of the given tangential position.
 float getCenterX()
          Returns the x-coordinate of the center of this converter.
 float getCenterY()
          Returns the y-coordinate of the center of this converter.
 float getInnerRadius()
          Returns the inner radius of this converter.
 int getOrientation()
          Returns the orientation of this polar converter.
 double getSpokeAngle(int spokeIndex)
          Returns the angle of a spoke.
 int getSpokeCount()
          Returns the number of spokes of this converter.
 float getSpokeX(int spokeIndex, float radialPosition)
          Returns the x-coordinate of a spoke at a given position.
 float getSpokeY(int spokeIndex, float radialPosition)
          Returns the y-coordinate of a spoke at a given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NET

public static final int NET
Equal to ChartConstants.NET

See Also:
Constant Field Values

RING

public static final int RING
Equal to ChartConstants.RING

See Also:
Constant Field Values
Constructor Detail

PolarConverter

public PolarConverter(ScaleModel tangentialScaleModel,
                      int orientation,
                      float innerRadius)
Constructs a new PolarConverter that uses the given scale model as the tangential scale model.

Parameters:
tangentialScaleModel - The scale that goes along the bow.
orientation - The orientation of the converter, either NET or RING.
innerRadius - The inner radius.
Method Detail

getSpokeCount

public int getSpokeCount()
Returns the number of spokes of this converter.

Returns:
The number of spokes.

getSpokeX

public float getSpokeX(int spokeIndex,
                       float radialPosition)
Returns the x-coordinate of a spoke at a given position.

Parameters:
spokeIndex - The index of the spoke, must be >= 0 and < getSpokeCount().
radialPosition - The position in the thickness, i.e. measured from the inner radius.
Returns:
The x-coordinate of a spoke.

getSpokeY

public float getSpokeY(int spokeIndex,
                       float radialPosition)
Returns the y-coordinate of a spoke at a given position.

Parameters:
spokeIndex - The index of the spoke, must be >= 0 and < getSpokeCount().
Returns:
The y-coordinate of a spoke.

getSpokeAngle

public double getSpokeAngle(int spokeIndex)
Returns the angle of a spoke.

Parameters:
spokeIndex - The index of the spoke, must be >= 0 and < getSpokeCount().
Returns:
The angle of the spoke in radians.

convertX

public float convertX(float tangentialPosition,
                      float radialPosition)
Returns the x-coordinate of a point.

Parameters:
tangentialPosition - The tangential position of the point.
radialPosition - The radial position of the point.
Returns:
The x-coordinate of the point.

convertY

public float convertY(float tangentialPosition,
                      float radialPosition)
Returns the y-coordinate of a point.

Parameters:
tangentialPosition - The tangential position of the point.
radialPosition - The radial position of the point.
Returns:
The y-coordinate of the point.

getAngle

public double getAngle(float tangentialPosition)
Returns the angle of the given tangential position.

Returns:
The angle of the given tangential position.

getOrientation

public int getOrientation()
Returns the orientation of this polar converter.

Returns:
Either NET or RING.

getCenterX

public float getCenterX()
Returns the x-coordinate of the center of this converter.

Returns:
The x-coordinate of the center of this converter.

getCenterY

public float getCenterY()
Returns the y-coordinate of the center of this converter.

Returns:
The y-coordinate of the center of this converter.

getInnerRadius

public float getInnerRadius()
Returns the inner radius of this converter.

Returns:
The inner radius of this converter.

ChartCat 1.2

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print