edu.jhu.htm.app
Class intersect

java.lang.Object
  |
  +--edu.jhu.htm.app.intersect

public class intersect
extends java.lang.Object

SPecifiying -xml now lets this program read XML files structred like This example code demonstrates the intersection functionality of the HTMindexImp. It can be invoked by

  java edu.jhu.htm.app.intersect level savelevel domainfile [-b]
  

where

          level	 : the level depth to build the index
          domainfile: file containing a domain
          [-nranges n]  : number of ranges to keep
 

The level and savelevel just indicate the index depth. The -b switch might speed up things for depths up to 7 with large-area domains. Domain files:

A domain is a set of convexes, connected by logical OR. A convex is a set of constraints, connected by logical AND. A constraint specifies a cap on the unit sphere by specifying a vector 'a' and a distance 'd' from the origin. 's' is the opening angle defining the cap.

Example: positive distance a = (1,0,0), d = 0.5, s = 60 degrees

 .				   ____
 .				---	---
 .			   /		/|\
 .			  /		/ |=\
 .			 |		/  |==|	 this side is in the convex.
 .			|		/\s |===|
 .			|------------|---| -> direction a
 .			|		\   |===|
 .			 |		\  |==|
 .			  \		\ |=/
 .			   \		\|/
 .				---____---
 .
 .
 .					 <-d-> is positive (s < 90)
 

Example: negative distance a = (-1,0,0), d = -0.5, s = 120 degrees

 .				   ____
 .				---====---
 .  this side is /========/|\
 .  in the	  /========/=| \
 .  convex	 |==== s__/==|  |
 .			|===== / /===|   |
 .  dir. a <- |------------|---|  'hole' in the sphere
 .			|========\===|   |
 .			 |========\==|  |
 .			  \========\=| /
 .			   \========\|/
 .				---____---
 .
 

A constraint is represented in the file as a set of 4 floatingpoint numbers x y z d where a=(x,y,z). Example:

   1 0 0 0.5
 

A convex is the area defined by several constraints on the sphere that is common to all constraints. Of course such an area has to be convex.

A convex in the file is defined by a number (number of constraints in the convex) followed by as many convexes (each on one line.) Example:

   4
   0.5 0.707107 0.5 0.58077530122080200
   0.5 0.707107 0.5 0.84077530122080200
   -0.5 -0.907107 0.3  -0.87530122080200
   0.2 -0.907107 0.3  -0.77530122080200
 

A domain is an accumulation of convexes. A domain in the domainfile is represented by a number (number of convexes) followed by that many convexes. A domainfile may only contain one domain. It may contain comment lines, starting with #. Special Identifiers

The domain file accepts several special convex identifiers to read in special formats. These identifiers must come as a single comment line before the data, and no additional comments are allowed These are

         #TRIANGLE			- the next three lines are triangle corners
         #TRIANGLE_RADEC		- same, given in ra/dec
         #RECTANGLE			- the next four lines are rectangle corners
         #RECTANGLE_RADEC		- same, given in ra/dec
         #CONVEX			- read convex in default format
         #CONVEX_RADEC		- read the convex in ra/dec format
 
Examples of a domain files:

Example 1:

 #DOMAIN
 1
 #CONVEX
 3
  0.5 0.707107 0.5 0.58077530122080200
  0.5 0.5 0.707107 0.63480775301220802
  0.707107 -0.5 0.5 0.8480775301220802
 

Example 2:

 #DOMAIN
 2
 #CONVEX
 4
  0 0 1 0.3
  -1 -3 -5 -0.97
  5 -3 -10 -0.97
  2 2 -5 -0.97
 #CONVEX_RADEC
 1
 25.23 -55.9 0.99
 

Example 3:

 #DOMAIN
 1
 #RECTANGLE_RADEC
 54 29
 54 30
 55 29
 55 30
 

Example 4:

 #DOMAIN
 1
 #TRIANGLE
 0 0 1
 0 0.9 0.9
 0.9 0 0.9
 

Example of a run of intersect:

 %intersect 4 2 example1
 
OUTPUT:
 #DOMAIN
 1
 #CONVEX
 3
 0.707107 -0.5 0.5 0.848078
 0.5 0.5 0.707107 0.634808
 0.5 0.707107 0.5 0.580775

Version:
$Revision : $
Author:
Peter Kunszt

Constructor Summary
intersect()
           
 
Method Summary
static void expandList(java.io.PrintStream out, HTMrange range, boolean symbolic)
           
static void main(java.lang.String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

intersect

public intersect()
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
java.lang.Exception

expandList

public static void expandList(java.io.PrintStream out,
                              HTMrange range,
                              boolean symbolic)
                       throws java.lang.Exception
java.lang.Exception