org.jcae.mesh.amibe.patch
Class Calculus2D

java.lang.Object
  extended by org.jcae.mesh.amibe.patch.Calculus2D
All Implemented Interfaces:
Calculus

public class Calculus2D
extends java.lang.Object
implements Calculus

Distance computations in 2D Euclidian space. This class is called from BasicMesh but may also be used if amibe is extended to mesh 2D surfaces.


Constructor Summary
Calculus2D(Mesh2D m)
          Constructor.
 
Method Summary
 double distance(Vertex2D start, Vertex2D end)
          Returns the 2D distance to another Vertex2D instance.
 double distance2(Vertex2D start, Vertex2D end, Metric2D m2)
          Returns square distance to another Vertex2D instance.
 double[] getBounds2D(Vertex2D vm)
          Returns bounds of unit ellipse centered at a point.
 double length(VirtualHalfEdge2D ot)
          Returns the 2D length of an edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calculus2D

public Calculus2D(Mesh2D m)
Constructor.

Parameters:
m - the Mesh2D being modified.
Method Detail

distance2

public double distance2(Vertex2D start,
                        Vertex2D end,
                        Metric2D m2)
Returns square distance to another Vertex2D instance.

Specified by:
distance2 in interface Calculus
Parameters:
start - first node
end - end node
m2 - metrics (unused)
Returns:
square distance between the two nodes.

distance

public double distance(Vertex2D start,
                       Vertex2D end)
Returns the 2D distance to another Vertex2D instance.

Specified by:
distance in interface Calculus
Parameters:
start - the first node
end - the node to which distance is computed.
Returns:
the distance between the two nodes.

length

public double length(VirtualHalfEdge2D ot)
Returns the 2D length of an edge.

Specified by:
length in interface Calculus
Parameters:
ot - the edge being evaluated
Returns:
the distance between its two endpoints.

getBounds2D

public double[] getBounds2D(Vertex2D vm)
Returns bounds of unit ellipse centered at a point. This routine returns a double array which represents enclosing bounding box of unit ellipse. This method is used by KdTree.getNearestVertex(org.jcae.mesh.amibe.ds.Mesh, org.jcae.mesh.amibe.ds.Vertex); if an octant does not intersect this bounding box, it does also not intersect unit ellipse.

Specified by:
getBounds2D in interface Calculus
Parameters:
vm - the vertex on which metrics is evaluated
Returns:
bounding box of unit ellipse