Module omix.api

Class CurveSectionComputer<T extends AbstractDoubleVec<T>>

java.lang.Object
omix.util.math.curves.CurveSectionComputer<T>
Type Parameters:
T - Vector type in 2D or 3D coordinates
Direct Known Subclasses:
ArcSectionComputer2D, BezierSectionComputer

public abstract class CurveSectionComputer<T extends AbstractDoubleVec<T>>
extends Object
This class generalizes computation of a parameterised curve sections.
Author:
Dr. Peter Droste, Omix Visualization
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected CurveSectionComputer()
    constructs a new curve section computation unit.
  • Method Summary

    Modifier and Type Method Description
    abstract T accelerationAt​(double t)
    returns the acceleration (second derivative) of the curve at the parameter t.
    abstract double getCurveSectionLength()
    returns the curve section length.
    double getT​(T point)
    computes the parameter t matching to the given point on the curve with a default correctness.
    double getT​(T point, double epsilon)
    computes the parameter t matching to the given point on the curve with the given correctness.
    boolean isArc()
    returns true if curve section is an arc.
    boolean isCubic()
    returns true if curve section is a cubic curve.
    boolean isLine()
    returns true if curve section is a line.
    boolean isQuad()
    returns true if curve section is a quad curve.
    abstract T pointAt​(double t)
    returns the point of the curve at the parameter t.
    abstract T tangentAt​(double t)
    returns the tangent (first derivative) of the curve at the parameter t.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CurveSectionComputer

      protected CurveSectionComputer()
      constructs a new curve section computation unit.
  • Method Details

    • getCurveSectionLength

      public abstract double getCurveSectionLength()
      returns the curve section length.
      Returns:
      length
    • accelerationAt

      public abstract T accelerationAt​(double t)
      returns the acceleration (second derivative) of the curve at the parameter t.
      Parameters:
      t - parameter
      Returns:
      second derivative
    • tangentAt

      public abstract T tangentAt​(double t)
      returns the tangent (first derivative) of the curve at the parameter t.
      Parameters:
      t - parameter
      Returns:
      first derivative
    • pointAt

      public abstract T pointAt​(double t)
      returns the point of the curve at the parameter t.
      Parameters:
      t - parameter
      Returns:
      point
    • isLine

      public boolean isLine()
      returns true if curve section is a line.
      Returns:
      line
    • isQuad

      public boolean isQuad()
      returns true if curve section is a quad curve.
      Returns:
      quad
    • isCubic

      public boolean isCubic()
      returns true if curve section is a cubic curve.
      Returns:
      cubic
    • isArc

      public boolean isArc()
      returns true if curve section is an arc.
      Returns:
      arc
    • getT

      public double getT​(T point)
      computes the parameter t matching to the given point on the curve with a default correctness. Same as getT(point, 0.00001).
      Parameters:
      point -
      Returns:
      parameter t
    • getT

      public double getT​(T point, double epsilon)
      computes the parameter t matching to the given point on the curve with the given correctness.
      Parameters:
      point -
      epsilon - maximal distance error
      Returns:
      parameter t