<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" 
               "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
  <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="../../../comsci/css/s011.css"/>
<link rel='SHORTCUT ICON' href='../../../comsci/images/FrameHome.ico' />
<style type="text/css">
</style>
<title> Half Space Number System
 </title>
</head>

<body>


<div class="message_right">

  <a href="http://validator.w3.org/check/referer">
    <img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid
	XHTML 1.1!" height="31" width="88" />
  </a>

  <a href="http://jigsaw.w3.org/css-validator/">
    <img style="width:88px;height:31px"
       src="http://jigsaw.w3.org/css-validator/images/vcss" 
       alt="Valid CSS!" />
  </a>
  <br/>
  Created 2005-03-25 &nbsp; Modified 
<!--UPDATE_DATE_MODIFIED-->
<!--UPDATE_DATE_BEGIN-->
2007-02-13
<br/>
<a href="mailto:chelton.evans@yahoo.com">Chelton Evans</a>
<!--UPDATE_DATE_END-->
</div>


<h1>
<a href="geom.html"> <img alt="proj" src="../../../comsci/images/compgeom.png" /></a>
 Half Space Number System
<a href="../../../../index.html">
<img alt="home" src="../../../comsci/images/Frame.gif" /> </a>
</h1>

<p>
<a href="#Intro">Intro</a><br/>
<a href="#Half_Spaces">Half Spaces</a><br/>
<a href="#Test_if_a_Point_is_Above_the_Half_Space">
  Test if a Point is Above the Half space</a><br/>
<a href="g001.xml#Anticlockwise_Point_Ordering_Test_with_Half_Spaces"> 
 Anticlockwise Point Ordering Test with Half Spaces</a><br/>
<a href="#Half_Space_Number_System">Half Space Number System</a><br/>
<a href="#Constructing_Half_Spaces_from_Ordered_Points">
  Constructing Half Spaces from Ordered Points</a><br/>

<a href="#Half_Space_Multiplication_and_Addition">
  Half Space Multiplication and Addition</a><br/>

<a href="#Intersection_and_Union">
  Intersection and Union</a><br/>
<a href="#Point_and_Half_Space_Subtraction">
  Point and Half Space Subtraction</a><br/>


</p>

<div class="float25">
<a id="Intro"></a>
<h3>Intro</h3>

<p>Half spaces and their interaction with
 points can be viewed as a generalization
 of the 
&nbsp;
<math xmlns="&mathml;">
  <mi>&gt;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&lt;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&leq;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&GreaterEqual;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>==</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&NotEqual;</mi>  
</math> &nbsp; 

 relational operators.
 For example is a point above a plane can be 
 expresses as 
 &nbsp;
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>&gt;</mo>
  <mi>H</mi>
</math>.
</p>

<p>Here I bring together some of the maths
 of half spaces. While 2D examples are given
 the benefit of half spaces is of course they 
 generalize to any dimension so can be used
 anywhere.
</p>


</div>


<div class="float25">
<a id="Half_Spaces"></a>
<h2>Half Spaces</h2>

<ul>
<li>
A Point divides a line in two.
</li>
<li>
A Line divides a plane in two.
</li>
<li> A Plane divides a 3D space in two.</li>
</ul>

<p>A half space has a cutter one dimension less than
 the space it is cutting. Further the half space has
 a direction perpendicular to the cutter.
</p>


<p>
The half space are a type of partition because it partitions the 
 space in two.
Another partition is a circle where all the points are
 either inside or not inside the circle. 
</p>

<p>
Partitions have issues on the boundary - is a point
 inside or on the line, is the line included in the partition, 
 can we even determine this, does it matter in an algorithm or
 is this ambiguity why the algorithm works.
</p>

</div>


<div class="float25">
<a id="Half_Space_Number_System"></a>
<h2>Half Space Number System</h2>

<p>A half space number system can be defined
 as binary operations between a point and a half
 space, one on each side respectively.
</p>

<p>The operators are the familiar relational
 operators.
</p>

<p class="equ">

<math xmlns="&mathml;">
  <mi>&gt;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&lt;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&leq;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&GreaterEqual;</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>==</mi>  
</math> &nbsp; 
<math xmlns="&mathml;">
  <mi>&NotEqual;</mi>  
</math> &nbsp; 

</p>

<p class="equ">
Let a half space be composed of a partition
 in the space of 1 less in dimension to the space
 and a normal vector in the space.<br/>
 Let the partition be called a cutter.<br/> 
 The normal is perpendicular to the cutter.
</p>

<p>In the special case where the normal of the
 half space is zero the half space is 
 a partition. This is the == operator.
</p>

<p>I call the partition a cutter as it cuts the space.</p>

<p>The operators are dependent on the half space. 
 They indicate the nature of the half space.
 This makes writing the equation easy.
</p>

<p>When combined with other notation the algebra 
 becomes clear. For example to test if point q 
 is below the line 

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
</math>
 to

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
</math>
 using the 
<a href="#Constructing_Half_Spaces_from_Ordered_Points">
  Constructing Half Spaces from Ordered Points</a>
 notation here is the maths. <br/>

<math xmlns="&mathml;">
  <mi>q</mi>
  <mo>&lt;</mo>
  <mi>H</mi>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>,</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
</p>

<p>I also express this loosely by saying that the half space
<math xmlns="&mathml;">
  <mi>H</mi>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>,</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
 does not see the point q.
</p>



</div>

<div class="float25">
<img src="diagg00801.png" alt="diagg00801.png" />
</div>



<div class="float25">
<a id="Test_if_a_Point_is_Above_the_Half_Space"></a>
<h2>Test if a Point is Above the Half Space</h2>

<p class="equ">

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
</math>
 is a point on the half space. <br/>

<math xmlns="&mathml;">
  <mi>N</mi>
</math>

 is a normal vector pointing in the positive region of the half space. <br/>



<br/>
<math xmlns="&mathml;">
  <mo>(</mo>
  <mi>x</mi>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>)</mo>
  <mo>&CenterDot;</mo>
  <mi>N</mi>
  <mo>&gt;</mo>
  <mi>0</mi>
</math>


</p>

</div>





<div class="float25">
<a id="Half_Space_Multiplication_and_Addition"></a>
<h2>Half Space Multiplication and Addition</h2>

<p class="equ">Let multiplication of two half spaces be defined
 as having a point q belong to both partitions.<br/>
Let addition be that the point q is in either partition.
</p>

<p>Shapes can be composed by multiplying and adding
 half spaces. Here are some example in 2D. First
 testing a point inside and or on a triangle 
 boundary. Then a non convex shape.
</p>

<img src="diagg00805.png" alt="diagg00805.png" />


<p> See <a href="g022.xml"> 
Convexity and Shape Representation with Algebra</a>.
</p>





</div>



<div class="float25">
<a id="Constructing_Half_Spaces_from_Ordered_Points"></a>
<h2>Constructing Half Spaces from Ordered Points</h2>

<p>
A very nice feature of half spaces is that they can
 be constructed from a list of ordered points.
 We have to define what the order means.
</p>

<p class="equ">For example in 2D I have defined the half spaces
 as a left of the directed line from p<sub>0</sub> to p<sub>1</sub>.
</p>

<img src="diagg00806.png" alt="diagg00806.png" />


<p>In 3D let the normal from the half space point outwards
 from the anti clockwise point ordering.
</p>

<img src="diagg00807.png" alt="diagg00807.png" />

<p>Another variable could include whether or not the boundary
 is considered to be part of the half space.
</p>




</div>








<div class="float25">
<a id="Point_and_Half_Space_Subtraction"></a>
<h2>Point and Half Space Subtraction</h2>

<img src="diagg00804.png" alt="diagg00804.png" />

<p>By defining the half space and point relation &nbsp;
<math xmlns="&mathml;">
  <mi>q</mi>
  <mi>&gt;</mi>  
  <mi>H</mi>
</math> &nbsp; 
 and corresponding this with the equivalent dot product
 subtraction can be defined.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mo>(</mo>
  <mi>q</mi>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>)</mo>
  <mo>&CenterDot;</mo>
  <mi>N</mi>
  <mo>&gt;</mo>
  <mi>0</mi>
</math>
<br/>

<math xmlns="&mathml;">
  <mi>q</mi>
  <mo>&gt;</mo>
  <mi>H</mi>
</math>
<br/>

<math xmlns="&mathml;">
  <mi>q</mi>
  <mo>-</mo>
  <mi>H</mi>
  <mo>&gt;</mo>
  <mi>0</mi>
</math>
<br/>

<math xmlns="&mathml;">
  <mo>&Therefore;</mo>
  <mi>q</mi>
  <mo>-</mo>
  <mi>H</mi>
  <mo>:=</mo>
  <mo>(</mo>
  <mi>q</mi>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>)</mo>
  <mo>&CenterDot;</mo>
  <mi>N</mi>
</math>


</p>
  



</div>

<div class="spacer" />

<div class="float25">
<a id="Intersection_and_Union"></a>
<h2>Intersection and Union</h2>

<img src="diagg00803.png" alt="diagg00803.png" />


</div>

</body>
</html>



