HTM Index 1.0




jhu.htmIndex
Class SpatialConstraint

java.lang.Object
  |
  +--jhu.htmIndex.SpatialSign
        |
        +--jhu.htmIndex.SpatialConstraint

public class SpatialConstraint
extends SpatialSign

Spatial Constraint class 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)


Fields inherited from class jhu.htmIndex.SpatialSign
mIXED, nEG, pOS, sign_, zERO
 
Constructor Summary
SpatialConstraint()
          Default Constructor
SpatialConstraint(double distance)
          Construct by setting only the distance
SpatialConstraint(double x, double y, double z, double distance)
          Initialization constructor
SpatialConstraint(SpatialConstraint copy)
          Copy constructor
SpatialConstraint(SpatialVector vector, double distance)
          Initialization constructor
 
Method Summary
 boolean contains(SpatialVector vector)
          check whether a vector is inside this constraint
 double d()
          give back distance
 void invert()
          Invert a constraint
 void read(java.io.Reader in)
          read from a stream as X Y Z D
 void readRaDec(java.io.Reader in)
          read from a stream as RA DEC D
 java.lang.String toString()
          convert data to string
 SpatialVector v()
          give back constraint direction
 
Methods inherited from class jhu.htmIndex.SpatialSign
printSign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialConstraint

public SpatialConstraint()
Default Constructor

SpatialConstraint

public SpatialConstraint(double distance)
Construct by setting only the distance
Parameters:
distance - set the distance to the cap

SpatialConstraint

public SpatialConstraint(SpatialVector vector,
                         double distance)
Initialization constructor
Parameters:
vector - SpatialVector specifying the direction of the cap
distance - The distance of the cutting plane from the origin

SpatialConstraint

public SpatialConstraint(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

SpatialConstraint

public SpatialConstraint(SpatialConstraint copy)
Copy constructor
Parameters:
constraint - The constraint to be copied
Method Detail

invert

public void invert()
Invert a constraint

contains

public boolean contains(SpatialVector vector)
check whether a vector is inside this constraint
Parameters:
vector - SpatialVector to be checked
Returns:
True if inside constraint, False if outside

v

public SpatialVector v()
give back constraint direction
Returns:
SpatialVector of constraint direction

d

public double d()
give back distance
Returns:
distance from origin

toString

public java.lang.String toString()
convert data to string
Returns:
string containing vector and distance (4 numbers)
Overrides:
toString in class java.lang.Object

read

public void read(java.io.Reader in)
          throws java.io.IOException
read from a stream as X Y Z D
Parameters:
in - takes a Reader (an input stream)
See Also:
Reader

readRaDec

public void readRaDec(java.io.Reader in)
               throws java.io.IOException
read from a stream as RA DEC D

HTM Index 1.0





©Copyright The Johns Hopkins University 1999, All Rights Reserved.
See the HTM Homepage for details.
Last Build: Oct 26, 1999 Peter Z. Kunszt