|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.HObject
com.hedgehog.geo.GeometricObject
com.hedgehog.geo.twod.GeometricObject2D
com.hedgehog.geo.twod.curves.Curve2D
public abstract class Curve2D
Title: Curve2D - abstract base class of 2D curves.
Description: Abstract base class of 2D curve hierarchy.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software
| Field Summary | |
|---|---|
protected Point2D |
mp0
Curve end-point p0. |
protected Point2D |
mp1
Curve end-point p1. |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
Curve2D()
Default constructor. |
|
Curve2D(Curve2D object)
Copy constructor. |
|
Curve2D(ID id)
Constructor. |
|
Curve2D(Point2D p0,
Point2D p1)
Constructor. |
|
Curve2D(Point2D p0,
Point2D p1,
java.lang.String name,
ID id)
Constructor. |
|
Curve2D(java.lang.String name)
Constructor. |
|
Curve2D(java.lang.String name,
ID id)
Constructor. |
|
| Method Summary | |
|---|---|
Point2D |
commonEndPoint(Curve2D c)
Returns the end point which is common to both Curves (if one exists). |
double |
curvature(double u)
Returns the curvature of a curve at parametric point u. |
java.util.Vector<Point2D> |
curvePoints(int uPoints,
double umin,
double umax,
double tolerance)
Returns a vector of curve points that are evenly spaced between the specified umin and umax parametric variable values. |
double |
distanceBetweenTwoPointsAlongCurve(ParametricSegment segment)
Returns the distance measured along this curve between the two specified parametric variable points. |
double |
distanceBetweenTwoPointsAlongCurve(Point2D p,
Point2D q,
double tolerance)
Returns the distance measured along this curve between the two specified points. |
boolean |
equals(java.lang.Object object)
Tests whether or not two curves are equal, ie (p0,p1) is equivalent to (c.p0,c.p1); ie preserving the curve of p0 to p1. |
java.util.Vector<Point2D> |
evenlySpacedIntermediatePoints(int nPoints,
double tolerance)
Returns a vector of intermediate evenly spaced points on the curve (default is 10). |
Point2D |
getP0()
Returns the curve end-point p0. |
Point2D |
getP1()
Returns the curve end-point p1. |
double |
interpolation(FloatingPointVector vi,
double u)
Returns an interpolated value at the parametric point u from the values vi. |
boolean |
is2D()
Tests whether or not this object is a 2D object; ie true. |
boolean |
is3D()
Tests whether or not this object is a 3D object; ie false. |
boolean |
isCurve()
Tests whether or not this object is a curve; ie true. |
boolean |
isEndPoint(Point2D p,
double tolerance)
Returns logical-true if p is an end-point of a curve, else logical-false. |
boolean |
isEndPointP0(Point2D p,
double tolerance)
Returns logical-true if p is end-point p0 of this curve, else logical-false. |
boolean |
isEndPointP1(Point2D p,
double tolerance)
Returns logical-true if p is end-point p1 of this curve, else logical-false. |
boolean |
isGrid()
Tests whether or not this object is a grid; ie false. |
boolean |
isMesh()
Tests whether or not this object is a mesh; ie false. |
boolean |
isOpen()
Tests whether or not this curve is open; ie the end-points p0 and p1 are not the same point. |
boolean |
isP0Set()
Tests whether or not end-point p0 is non-null. |
boolean |
isP1Set()
Tests whether or not end-point p1 is non-null. |
boolean |
isPoint()
Tests whether or not this object is a point; ie false. |
boolean |
isPointSet()
Tests whether or not this object is a point set; ie false. |
boolean |
isShape()
Tests whether or not this object is a shape; ie false. |
boolean |
isSurface()
Tests whether or not this object is a surface; ie false. |
boolean |
isValid()
Tests whether or not a Curve2D object is valid. |
double |
jacobianDeterminant(double zeta,
InterpolationOrder order,
Vector2D lx,
Vector2D ly)
Returns the Jacobian matrix (i.e. |
double |
length()
Returns the total length of this general 2D curve using approximate Gauss integration by integrating a length function based on the approximate tangent() method. |
double |
length(ParametricSegment segment)
Returns the length of this general 2D curve along the parametric segment [u1:u2] using approximate Gauss integration. |
PairDouble |
lengthCoordinates(Point2D p,
double tolerance)
Returns the length coordinates (pair |
double |
lengthFunction(HDouble u)
Private method for computing the of a general curve for use with OneVariableFunction. |
double |
maximumX(double tolerance)
Returns the maximum x-value of this curve. |
double |
maximumY(double tolerance)
Returns the minimum y-value of this curve. |
Point2D |
midPoint()
Returns the mid-point of this curve. |
double |
minimumDistance(Point2D p,
double tolerance)
Returns the minimum distance between the specified point and this curve. |
double |
minimumX(double tolerance)
Returns the minimum x-value of this curve. |
double |
minimumY(double tolerance)
Returns the minimum y-value of this curve. |
Point2D |
nearestEndPoint(double u,
double tolerance)
Returns the nearest end point to the specified parametric variable. |
Point2D |
nearestEndPoint(Point2D p,
int method,
double tolerance)
Returns the nearest end-point to the specified point, p, using the indicated method. |
Point2D |
nearestPoint(Point2D q,
double tolerance,
HDouble uNearest)
Returns the nearest point on this curve to the specified point. |
Point2D |
nearestPointApprox(Point2D q,
int nuPoints,
double tolerance,
HDouble uNearest)
Returns the approximate nearest point on this curve to the specified point. |
Point2D |
otherEndPoint(Point2D p,
double tolerance)
Returns an end-point other than the one specified. |
double |
parametricVariable(Point2D p,
double tolerance)
Returns the parametric variable distance [0:1] between the specified point and end-point p0 of this curve to the specified tolerance. |
boolean |
pointOfCurve(Point2D p,
double tolerance)
Tests if the specified point is an end-point of this curve. |
abstract Point2D |
pointOnCurve(double u,
double tolerance)
Returns a point on this curve at the specified parametric distance from end-point p0. |
abstract boolean |
pointOnCurve(Point2D p,
double tolerance)
Tests whether or not the specified point is on this curve. |
abstract boolean |
pointOnLeft(Point2D p,
double tolerance)
Tests whether or not the specified point is on the left of this curve. |
abstract boolean |
pointOnRight(Point2D p,
double tolerance)
Tests whether or not the specified point is on the right of this curve. |
HDouble |
pointXOnCurve(HDouble u)
Returns the x value of the specified parametric-variable value. |
HDouble |
pointYOnCurve(HDouble u)
Returns the y value of the specified parametric-variable value. |
Point2D |
randomPoint()
Returns a random point on the curve between the end-points. |
void |
reverse()
Reverses the end-points p0 and p1 such that p0 points to p1 and p1 points to p0. |
boolean |
sameCurve(Curve2D c,
boolean bothSenses,
double tolerance)
Tests whether or not two curves are equivalent. |
boolean |
sameEndPoints(Curve2D c,
double tolerance)
Tests whether or not two curves share the same end-points, irrespective of curve sense. |
Vector2D |
secondDerivative(double u)
Returns the second derivative of a curve at parametric point u using 3 point approximate differentiation formulae with h=1e-03. |
void |
setP0(Point2D p0)
Sets end-point p0. |
void |
setP1(Point2D p1)
Sets end-point p1. |
FloatingPointFullMatrix |
shapeFunctions(double u,
InterpolationOrder order)
Returns the shape functions of a curve given a specified point. |
FloatingPointFullMatrix |
shapeFunctions(Point2D p,
InterpolationOrder order,
double tolerance)
Returns the shape functions of a curve given a specified point. |
double |
shapeFunctionsDerivatives(int ni,
double zeta,
InterpolationOrder order)
Returns the derivative of a shape function Ni at parametric point zeta=zeta2 with respect to zeta for a given interpolation order. |
Point2D |
shareEndPoint(Curve2D c,
double tolerance)
Tests whether or not two curves share the same end-point. |
Vector2D |
tangent(double u)
Returns the tangent vector at parametric point u. |
Vector2D |
tangent(Point2D p)
Returns the tangent vector at the specified point. |
PolyStraightLine2D |
toPolyStraightLine2D(int nPoints,
double umin,
double umax,
double tolerance)
Returns a PolyStraightLine2D equivalent object of this genral Curve2D object. |
java.lang.String |
toString()
Returns a String representation of a Curve2D object. |
TriplePQR<Vector2D,Vector2D,HDouble> |
trihedron(double u)
Returns the trihedron triple (t,p,b) at parametric point u[0:1]. |
double |
unitBiNormalVector(double u)
Returns the unit bi-normal vector (uxp) at parametric point u. |
Vector2D |
unitPrincipalNormalVector(double u)
Returns the unit principal normal vector (u'/curvature) at parametric point u. |
| Methods inherited from class com.hedgehog.geo.GeometricObject |
|---|
objectDimension |
| Methods inherited from class com.hedgehog.HObject |
|---|
clone, compare, compareTo, copy, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.hedgehog.model.ModelObject |
|---|
childModelObjects, databaseInsertStatement, databaseUpdateStatement, fromDatabase, fromXMLNode, toX3DNode, toXMLNode |
| Field Detail |
|---|
protected Point2D mp0
protected Point2D mp1
| Constructor Detail |
|---|
public Curve2D()
public Curve2D(Point2D p0,
Point2D p1)
p0 - End-point p0.p1 - End-point p1.
public Curve2D(Point2D p0,
Point2D p1,
java.lang.String name,
ID id)
p0 - End-point p0.p1 - End-point p1.name - Object name.id - Object ID.public Curve2D(java.lang.String name)
name - Object name.public Curve2D(ID id)
id - Object ID.
public Curve2D(java.lang.String name,
ID id)
name - Object name.id - Object ID.public Curve2D(Curve2D object)
object - Object to copy.| Method Detail |
|---|
public boolean equals(java.lang.Object object)
equals in interface java.util.Comparatorequals in class HObjectobject - Objectto compare against this object.
public Vector2D tangent(double u)
throws java.lang.IllegalArgumentException
u - Parametric variable u. Must be in the range [0:1].
java.lang.IllegalArgumentException - Throws exception if u is outside the range [0:1].
public Vector2D tangent(Point2D p)
throws java.lang.IllegalArgumentException
p - Point at which to determine tanget.
java.lang.IllegalArgumentException - Thrown if p is null or not on this curve.public TriplePQR<Vector2D,Vector2D,HDouble> trihedron(double u)
u - Parametric variable value at which the trihedron is to be determined.
public double unitBiNormalVector(double u)
throws java.lang.IllegalArgumentException
u - Parametric variable value at which the unit bi-normal is to be determined. Must be in the range [0:1].
java.lang.IllegalArgumentException - Thrown if u is out of range [0:1].
public Vector2D unitPrincipalNormalVector(double u)
throws java.lang.IllegalArgumentException
u - Parametric variable value at which the unit principal normal is to be determined. Must be in the range [0:1].
java.lang.IllegalArgumentException - Thrown if u is out of range [0:1].
public double curvature(double u)
throws java.lang.IllegalArgumentException
u - Parametric variable value on curve measured from end-point p0. Must be in the range [0:1].
java.lang.IllegalArgumentException - Thrown if u not in the range [0:1].
public Vector2D secondDerivative(double u)
throws java.lang.IllegalArgumentException
u - Parametric variable value on curve measured from end-point p0. Must be in the range [0:1].
java.lang.IllegalArgumentException - Thrown if u not in range [0:1].
public double jacobianDeterminant(double zeta,
InterpolationOrder order,
Vector2D lx,
Vector2D ly)
throws java.lang.IllegalArgumentException
zeta - Parametric-variable value. Must be in range [0:1].order - Interpolation order. Must be LINEAR, QUADRATIC or CUBIC.lx - Local x'-axis.ly - Local y'-axis.
java.lang.IllegalArgumentException - Thrown if zeta is not on the curve.public Point2D midPoint()
public double lengthFunction(HDouble u)
u - Parametric variable u.
public double length()
public double length(ParametricSegment segment)
throws java.lang.IllegalArgumentException
segment - Parametric segment.
java.lang.IllegalArgumentException - Thrown if segment is invalid.
public double parametricVariable(Point2D p,
double tolerance)
p - Point on this curve to determine minimum distance between and this curve.tolerance - Required tolerance.
public PairDouble lengthCoordinates(Point2D p,
double tolerance)
throws java.lang.IllegalArgumentException
p - Test point.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if p not on this curve.
public FloatingPointFullMatrix shapeFunctions(Point2D p,
InterpolationOrder order,
double tolerance)
throws java.lang.IllegalArgumentException
p - Point on curve at which require shape functions.order - Interpolation order: linear, quadratic and cubic.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if p is null of not on this curve.
public FloatingPointFullMatrix shapeFunctions(double u,
InterpolationOrder order)
throws java.lang.IllegalArgumentException
u - Parametric-variable value at point where shape functions are required.order - Interpolation order: linear, quadratic and cubic.
java.lang.IllegalArgumentException - Thrown if p is null of not on this curve.
public double shapeFunctionsDerivatives(int ni,
double zeta,
InterpolationOrder order)
throws java.lang.IllegalArgumentException
ni - Indicates which shape function the derivative is with respect to, which is dependent on the interpolation order:
linear interpolation the vertices are 1(zeta=1) and 2(zeta=0); 1<=ni<=2.
quadratic interpolation the end-vertices 1(zeta=1), 3(zeta=0) and mid-edge vertex 2(zeta=0.5); 1<=ni<=3.
cubic interpolation the end-vertices 1(zeta=1), 4(zeta=0) and edge vertices 2(zeta=1/3) and 3(zeta=2/3); 1<=ni<=4.zeta - Parametric variable.order - Interpolation order: LINEAR, QUDARATIC or CUBIC.
java.lang.IllegalArgumentException - Thrown if t is outside the range [0:1] or ni is out of range for the specified interpolation order:
LINEAR: 1<=ni<=2
QUDARATIC: 1<=ni<=3
CUBIC: 1<=ni<=4
public double interpolation(FloatingPointVector vi,
double u)
throws java.lang.IllegalArgumentException
vi - Vector of values to interpolate. Must be of size 2 for linear interpolation, size 3 or quadratic interpolation and size 4 for cubic interpolation.u - Parametric-variable value at which interpolated value is required.
java.lang.IllegalArgumentException - Thrown if t is out of range 0<=t<=1 or the number of elements of vi is out of range 2<=vi<=4.
public double minimumDistance(Point2D p,
double tolerance)
p - Point from which to determine the minimum distance between and this curve.tolerance - Required tolerance.
public Point2D nearestEndPoint(Point2D p,
int method,
double tolerance)
throws java.lang.IllegalArgumentException
p - Point to test.method - Method used: 0(parametric variable) or 1(straight-line distance).tolerance - Required tolerance used for testing p lies on this curve.
java.lang.IllegalArgumentException - Thrown if p is null or method is invalid.
public Point2D nearestEndPoint(double u,
double tolerance)
throws java.lang.IllegalArgumentException
u - Parametric-variable. Must be in the range [0:1].tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if u is out of range [0:1].
public Point2D nearestPointApprox(Point2D q,
int nuPoints,
double tolerance,
HDouble uNearest)
throws java.lang.IllegalArgumentException
q - Point to find nearest point.nuPoints - Number of sample u points to test for the nearest point. Must be >= 2. Typically set to 100.tolerance - Required tolerance.uNearest - Set upon return to the approximate nearest parametric-variable u.
java.lang.IllegalArgumentException - Thrown if nuPoints < 2.
public Point2D nearestPoint(Point2D q,
double tolerance,
HDouble uNearest)
q - Point to find nearest point.tolerance - Required tolerance.uNearest - Set upon return to the approximate nearest parametric-variable u.
public double distanceBetweenTwoPointsAlongCurve(ParametricSegment segment)
segment - Parametric curve segment.
public double distanceBetweenTwoPointsAlongCurve(Point2D p,
Point2D q,
double tolerance)
p - Left-hand point on curve.q - Right-hand point on curve.tolerance - Required tolerance.
public java.util.Vector<Point2D> evenlySpacedIntermediatePoints(int nPoints,
double tolerance)
throws java.lang.IllegalArgumentException
nPoints - Number of points.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if nPoints<=0.
public java.util.Vector<Point2D> curvePoints(int uPoints,
double umin,
double umax,
double tolerance)
throws java.lang.IllegalArgumentException
uPoints - Number of points along the curve, including the end-points.umin - Minimum u value.umax - Maximum u value.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if upoints<2 or umin and umax are out of range [0:1] or umin>=umax.public Point2D randomPoint()
public boolean isOpen()
public boolean isValid()
public boolean isP0Set()
public boolean isP1Set()
public boolean isEndPoint(Point2D p,
double tolerance)
p - End-point to test.tolerance - Required tolerance.
public boolean isEndPointP0(Point2D p,
double tolerance)
p - End-point to test.tolerance - Required tolerance.
public boolean isEndPointP1(Point2D p,
double tolerance)
p - End-point to test.tolerance - Required tolerance.
public Point2D otherEndPoint(Point2D p,
double tolerance)
p - Point on this curve for which the other end-point is returned.tolerance - Required tolerance.
public boolean pointOfCurve(Point2D p,
double tolerance)
p - Point to test.tolerance - Require tolerance.
public Point2D getP0()
public Point2D getP1()
public void setP0(Point2D p0)
p0 - New end-point p0.public void setP1(Point2D p1)
p1 - New end-point p1.
public boolean sameEndPoints(Curve2D c,
double tolerance)
c - Curve to compare.tolerance - Required tolerance.
public boolean sameCurve(Curve2D c,
boolean bothSenses,
double tolerance)
c - Curve to compare with this curve.bothSenses - If true then both senses of the curve are compared, else just sense (p0-p1) sense.tolerance - Required tolerance.
public Point2D commonEndPoint(Curve2D c)
c - Curve to compare against this curve.
public Point2D shareEndPoint(Curve2D c,
double tolerance)
c - Curve to test with this curve for common end-point.tolerance - Required tolerance.
public void reverse()
public java.lang.String toString()
toString in class java.lang.Object
public PolyStraightLine2D toPolyStraightLine2D(int nPoints,
double umin,
double umax,
double tolerance)
throws java.lang.IllegalArgumentException
nPoints - Number of points on poly-straight line.umin - Minimum parametric-variable value.umax - Maximum parametric-variable value.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if nPoints<2, umin/umax out of range [0:1] or umin>=umax.
public HDouble pointXOnCurve(HDouble u)
throws java.lang.IllegalArgumentException
u - Parametric-variable value.
java.lang.IllegalArgumentException - Thrown if u is out of range [0:1].
public HDouble pointYOnCurve(HDouble u)
throws java.lang.IllegalArgumentException
u - Parametric-variable value.
java.lang.IllegalArgumentException - Thrown if u is out of range [0:1].
public double minimumX(double tolerance)
throws FunctionEvaluationException
tolerance - Required tolerance.
FunctionEvaluationException - Thrown if an error occurred calling optimisationBFGS().
public double minimumY(double tolerance)
throws FunctionEvaluationException
tolerance - Required tolerance.
FunctionEvaluationException - Thrown if an error occurred calling optimisationBFGS().
public double maximumX(double tolerance)
throws FunctionEvaluationException
tolerance - Required tolerance.
FunctionEvaluationException - Thrown if an error occurred calling optimisationBFGS().
public double maximumY(double tolerance)
throws FunctionEvaluationException
tolerance - Required tolerance.
FunctionEvaluationException - Thrown if an error occurred calling optimisationBFGS().public boolean is2D()
is2D in class GeometricObject2Dpublic boolean is3D()
is3D in class GeometricObject2Dpublic boolean isPoint()
isPoint in class GeometricObjectpublic boolean isPointSet()
isPointSet in class GeometricObjectpublic boolean isCurve()
isCurve in class GeometricObjectpublic boolean isGrid()
isGrid in class GeometricObjectpublic boolean isMesh()
isMesh in class GeometricObjectpublic boolean isSurface()
isSurface in class GeometricObjectpublic boolean isShape()
isShape in class GeometricObject
public abstract Point2D pointOnCurve(double u,
double tolerance)
throws java.lang.IllegalArgumentException
u - Parametric variable in range [0:1].tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if u is out of range.
public abstract boolean pointOnCurve(Point2D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public abstract boolean pointOnLeft(Point2D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
public abstract boolean pointOnRight(Point2D p,
double tolerance)
p - Point to test.tolerance - Required tolerance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||