Class AlgorithmArcLength

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmArcLength
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class AlgorithmArcLength extends AlgorithmBase
This algorithm calculates the arc-length of a Bspline fit to user defined control points. This algorithm calculates the entire curve length and also is able to calculate the arc-length between two points.
Version:
0.1 April 27, 1998
  • Field Details

    • INTEGRAL_ORDER

      public static final int INTEGRAL_ORDER
      DOCUMENT ME!
      See Also:
    • INVLEN_MAXITER

      public static final int INVLEN_MAXITER
      DOCUMENT ME!
      See Also:
    • INVLEN_TOLERANCE

      public static final float INVLEN_TOLERANCE
      DOCUMENT ME!
      See Also:
    • bSpline

      private AlgorithmBSpline bSpline
      DOCUMENT ME!
    • rom

      private float[][] rom
      DOCUMENT ME!
    • totalLen

      private float totalLen
      DOCUMENT ME!
    • xPoints

      private float[] xPoints
      DOCUMENT ME!
    • yPoints

      private float[] yPoints
      DOCUMENT ME!
    • zPoints

      private float[] zPoints
      DOCUMENT ME!
  • Constructor Details

    • AlgorithmArcLength

      public AlgorithmArcLength(float[] xPts, float[] yPts)
      Algorithm constructor.
      Parameters:
      xPts - x coordinate control points
      yPts - y coordinate control points
    • AlgorithmArcLength

      public AlgorithmArcLength(float[] xPts, float[] yPts, float[] zPts)
      Algorithm constructor.
      Parameters:
      xPts - x coordinate control points
      yPts - y coordinate control points
  • Method Details

    • getTotalArcLength

      public float getTotalArcLength()
      Returns total arc-length of the segment.
      Returns:
      DOCUMENT ME!
    • invlen

      public float invlen(float pct)
      Finds the point at some percentage along the curve using simple midpoint root finding algorithm.
      Parameters:
      pct - percentage indicating where one would
      Returns:
      position indicates
    • invlenNewton

      public float invlenNewton(float pct)
      Finds the point at some percentage along the curve using Newtons method of root finding.
      Parameters:
      pct - percentage indicating where one would
      Returns:
      position indicates
    • runAlgorithm

      public void runAlgorithm()
      DOCUMENT ME!
      Specified by:
      runAlgorithm in class AlgorithmBase
    • setPoints

      public void setPoints(float[] xPts, float[] yPts)
      Sets the controls points of the Bspline and calculates the total arc-length.
      Parameters:
      xPts - x coordinate control points
      yPts - y coordinate control points
    • setPoints

      public void setPoints(float[] xPts, float[] yPts, float[] zPts)
      Sets the controls points of the Bspline and calculates the total arc-length.
      Parameters:
      xPts - x coordinate control points
      yPts - y coordinate control points
    • length

      public float length(float a, float b)
      The length is calculated between to points a,b using Romberg integration.
      Parameters:
      a - starting position
      b - ending position b > a and b range
      Returns:
      length returns arc-length of the segment
    • speed

      private float speed(float q)
      Calculates the speed at some point q.
      Parameters:
      q - the point where the speed is calculated
      Returns:
      speed the speed ( magnitude ) is returned