edu.jhu.htm.core
Class Constraint

java.lang.Object
  |
  +--edu.jhu.htm.core.Sign
        |
        +--edu.jhu.htm.core.Constraint

public class Constraint
extends Sign

The Constraint is really a cone on the sky-sphere. It is characterized by its direction a_, the opening angle s_ and its cosine -- the distance of the plane intersecting the sphere and the sphere center. If d_ = 0, we have a half-sphere. If it is negative, we have a 'hole' i.e. the room angle is larger than 90degrees. Example: positive distance

 .                   ____
 .                ---    ---
 .               /        /|\
 .              /        / |=\
 .             |        /  |==|     this side is in the convex.
 .            |        /\s |===|
 .            |------------|---| -> direction a
 .            |        \   |===|
 .             |        \  |==|
 .              \        \ |=/
 .               \        \|/
 .                ---____---
 .
 .
 .                     <-d-> is positive (s < 90)
 
    
Example: negative distance
 .                   ____
 .                ---====---
 .  this side is /========/|\
 .  in the      /========/=| \
 .  convex     |==== s__/==|  |
 .            |===== / /===|   |
 .  dir. a <- |------------|---|  'hole' in the sphere
 .            |========\===|   |
 .             |========\==|  |
 .              \========\=| /
 .               \========\|/
 .                ---____---
 .
 .
 .                     <-d-> is negative (s > 90)
 
for d=0 we have a half-sphere. Combining such, we get triangles, rectangles etc on the sphere surface (pure ZERO convexes)
  Current Version
  ===============
  ID:	$Id: Constraint.java,v 1.3 2003/02/19 15:46:11 womullan Exp $
  Revision: 	$Revision: 1.3 $
  Date/time:	$Date: 2003/02/19 15:46:11 $
 

Version:
$Revision: 1.3 $
Author:
Wil

Field Summary
 Vector3d a_
           
 double d_
           
 double s_
           
 
Fields inherited from class edu.jhu.htm.core.Sign
mIXED, nEG, pOS, sign_, zERO
 
Constructor Summary
Constraint()
          Default Constructor
Constraint(Constraint copy)
          Copy constructor
Constraint(double distance)
          Construct by setting only the distance
Constraint(double x, double y, double z, double distance)
          Initialization constructor
Constraint(Vector3d vector, double distance)
          Initialization constructor
 
Method Summary
 boolean contains(Vector3d vector)
          check whether a vector is inside this constraint
 double d()
          give back distance
 void invert()
          Invert a constraint
 java.lang.String toString()
          convert data to string
 Vector3d v()
          give back constraint direction
 
Methods inherited from class edu.jhu.htm.core.Sign
printSign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a_

public Vector3d a_

d_

public double d_

s_

public double s_
Constructor Detail

Constraint

public Constraint()
Default Constructor


Constraint

public Constraint(double distance)
Construct by setting only the distance

Parameters:
distance - set the distance to the cap

Constraint

public Constraint(Vector3d vector,
                  double distance)
Initialization constructor

Parameters:
vector - Vector3d specifying the direction of the cap
distance - The distance of the cutting plane from the origin

Constraint

public Constraint(double x,
                  double y,
                  double z,
                  double distance)
Initialization constructor

Parameters:
x - x-direction of vector specifying the direction of the cap
y - y-direction of vector specifying the direction of the cap
z - z-direction of vector specifying the direction of the cap
distance - The distance of the cutting plane from the origin

Constraint

public Constraint(Constraint copy)
Copy constructor

Method Detail

invert

public void invert()
Invert a constraint


contains

public boolean contains(Vector3d vector)
check whether a vector is inside this constraint

Parameters:
vector - Vector3d to be checked
Returns:
True if inside constraint, False if outside

v

public Vector3d v()
give back constraint direction

Returns:
Vector3d of constraint direction

d

public double d()
give back distance

Returns:
distance from origin

toString

public java.lang.String toString()
convert data to string

Overrides:
toString in class java.lang.Object
Returns:
string containing vector and distance (4 numbers)