delaunay_triangulation
Class Triangle_dt

java.lang.Object
  extended by delaunay_triangulation.Triangle_dt

public class Triangle_dt
extends java.lang.Object

This class represents a 3D triangle in a Triangulation!


Field Summary
static int _c2
           
static int _counter
           
 
Constructor Summary
Triangle_dt(Point_dt A, Point_dt B)
          creates a half plane using the segment (A,B).
Triangle_dt(Point_dt A, Point_dt B, Point_dt C)
          constructs a triangle form 3 point - store it in counterclockwised order.
 
Method Summary
 boolean contains(Point_dt p)
          computes if this triangle contains the point p.
 boolean isHalfplane()
          returns true iff this triangle is actually a half plane.
 Triangle_dt next_12()
          returns the consecutive triangle which shares this triangle p1,p2 edge.
 Triangle_dt next_23()
          returns the consecutive triangle which shares this triangle p2,p3 edge.
 Triangle_dt next_31()
          returns the consecutive triangle which shares this triangle p3,p1 edge.
 Point_dt p1()
          returns the first vertex of this triangle.
 Point_dt p2()
          returns the second vertex of this triangle.
 Point_dt p3()
          returns the 3th vertex of this triangle.
 java.lang.String toString()
           
 double z_value(Point_dt q)
          compute the Z value for the X,Y values of q.
 double z(double x, double y)
          compute the Z value for the X,Y values of q.
 Point_dt z(Point_dt q)
          compute the Z value for the X,Y values of q.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_counter

public static int _counter

_c2

public static int _c2
Constructor Detail

Triangle_dt

public Triangle_dt(Point_dt A,
                   Point_dt B,
                   Point_dt C)
constructs a triangle form 3 point - store it in counterclockwised order.


Triangle_dt

public Triangle_dt(Point_dt A,
                   Point_dt B)
creates a half plane using the segment (A,B).

Parameters:
A -
B -
Method Detail

isHalfplane

public boolean isHalfplane()
returns true iff this triangle is actually a half plane.


p1

public Point_dt p1()
returns the first vertex of this triangle.


p2

public Point_dt p2()
returns the second vertex of this triangle.


p3

public Point_dt p3()
returns the 3th vertex of this triangle.


next_12

public Triangle_dt next_12()
returns the consecutive triangle which shares this triangle p1,p2 edge.


next_23

public Triangle_dt next_23()
returns the consecutive triangle which shares this triangle p2,p3 edge.


next_31

public Triangle_dt next_31()
returns the consecutive triangle which shares this triangle p3,p1 edge.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

contains

public boolean contains(Point_dt p)
computes if this triangle contains the point p.

Parameters:
p - the query point
Returns:
true iff p is not null and is inside this triangle (Note: on boundary is considered inside!!).

z_value

public double z_value(Point_dt q)
compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.

Parameters:
q - query point (its Z value is ignored).
Returns:
the Z value of this plane implies by this triangle 3 points. NOTE: 1. this code was written for hi efficiency - no function call! - very ugly! 2. the code was not yet provven bug free (suspect non genertal position inputs).

z

public double z(double x,
                double y)
compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.

Parameters:
x - x-coordinate of the query point.
y - y-coordinate of the query point.
Returns:
z (height) value approximation given by the triangle it falls in.

z

public Point_dt z(Point_dt q)
compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.

Parameters:
q - query point (its Z value is ignored).
Returns:
q with updated Z value.