Module omix.api
Package omix.util.math.curves
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 parametert
.abstract double
getCurveSectionLength()
returns the curve section length.double
getT(T point)
computes the parametert
matching to the given point on the curve with a default correctness.double
getT(T point, double epsilon)
computes the parametert
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 parametert
.abstract T
tangentAt(double t)
returns the tangent (first derivative) of the curve at the parametert
.
-
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
returns the acceleration (second derivative) of the curve at the parametert
.- Parameters:
t
- parameter- Returns:
- second derivative
-
tangentAt
returns the tangent (first derivative) of the curve at the parametert
.- Parameters:
t
- parameter- Returns:
- first derivative
-
pointAt
returns the point of the curve at the parametert
.- 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
computes the parametert
matching to the given point on the curve with a default correctness. Same as getT(point, 0.00001).- Parameters:
point
-- Returns:
- parameter
t
-
getT
computes the parametert
matching to the given point on the curve with the given correctness.- Parameters:
point
-epsilon
- maximal distance error- Returns:
- parameter
t
-