<?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> Splines
 </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-11-12 &nbsp; Modified 
<!--UPDATE_DATE_MODIFIED-->
<!--UPDATE_DATE_BEGIN-->
2007-01-01
<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>
Splines
<a href="../../../../index.html">
<img alt="home" src="../../../comsci/images/Frame.gif" /> </a>
</h1>

<p>
<a href="#Two_Point_Interpolation_Generalized">
  Two Point Interpolation Generalized</a><br/>
<a href="../../../misc/proj/vecinterp/doc.xml#Visual_Comparision_of_Zero_Order_and_First_Order_Interpolation">
  Visual Comparision of Zero Order and First Order Interpolation</a><br/>
<a href="#Cubic_Hermit_Interpolation_Polynomial"> 
  Cubic Hermite Interpolation Polynomial</a><br/>
<a href="#Cubic_Hermite_Interpolation_in_Vector_Space">
  Cubic Hermite Interpolation in Vector Space</a><br/>
<a href="#Vector_Gradient_From_Vector_Points">
  Vector Gradient From Vector Points</a><br/>
<a href="#Continuous_Surface_from_Curves">
  Continuous Surface from Curves</a><br/>
<a href="#Cubic_Interpolation_with_Barycentric_Coordinates">
  Cubic Interpolation with Barycentric Coordinates</a><br/>
<a href="#Curve_Boundaries_on_3D_Triangle">
  Curve Boundaries on 3D Triangle</a><br/>
<a href="#References">References</a>
</p>


<div class="float25">
<a id="Cubic_Hermit_Interpolation_Polynomial"></a>
<h2>Cubic Hermit Interpolation Polynomial</h2>

<p>
Given a list of points and the first derivative at each point
 construct a cubic spline curve through the points. This example is
 in 2D Cartesian coordinate system. p are not vectors but scalars. 
</p>

<p>It is not too hard to see how this could get complicated.
 For example consider generalizing to 3D where the boundary is
 not a point but a curve. Now consider a generalized triangle which has 
 three boundaries which instead of being straight lines
 are curves.  Find a surface that is constrained by 
 the boundaries (imagine a mesh of these generalized triangles then
 how are they to be connected in a continuous way). 
 Then extend the problem so that the surface is 
 continuous in its first derivative.  
</p>

<p>In contrast the <a href="#Cubic_Hermite_Interpolation_in_Vector_Space">
  Cubic Hermite Interpolation in Vector Space </a>
 is a easy way to fit a curve between two points in any dimension.
 I will have to start reading for a similar successful solution for
 generalized triangles in 3D.
</p>

<p class="equ">
Let <br/> 
<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p</mi>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
</math> <br/>

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
</math> <br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p'</mi>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
</math> <br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p'</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
</math> <br/>

t varies between 0 and 1.


</p>



<p class="equ">
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mi>t</mi>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
</math>

</p>

<p class="equ">

<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>=</mo>
  <mi>0</mi>
</math>

 then  <br/>

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

</p>


<p class="equ">
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mi>t</mi>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>2</mi>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <mi>t</mi>
  <mo>+</mo>
  <mi>3</mi>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
</math> <br/>

<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>=</mo>
  <mi>0</mi>
</math>

 then  <br/>

<math xmlns="&mathml;">
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
</math>



</p>





<p class="equ">

<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>=</mo>
  <mi>1</mi>
</math>

 then  <br/>

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msub>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>2</mi>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>3</mi>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msub>
</math>

</p>

<p>Solving these two simultaneous equations.</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mi>t</mi>
  <mo>+</mo>
  <mo>(</mo>
  <mi>3</mi>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>3</mi>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>2</mi>
  <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>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mo>(</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>2</mi>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>2</mi>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>)</mo>

  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
</math>




</p>





</div>

<div class="float25">
<a id="Cubic_Hermite_Interpolation_in_Vector_Space"></a>
<h2>Cubic Hermite Interpolation in Vector Space</h2>

<p>Interpolate between two points in a vector space. See [1].
</p>

<p class="equ">
Let 

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>
 and 
<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>
 be an end point and the first derivative of that point. <br/>
Let 
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
</math>
 be the path where 

<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>=</mo>
  <mo>[</mo>
  <mi>0</mi>
  <mo>,</mo>
  <mi>1</mi>
  <mo>]</mo>
</math>

</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>

  <mo>(</mo>
  <mi>2</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>-</mo>
  <mi>3</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>1</mi>
  <mo>)</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>

  <mo>+</mo>
  <mo>(</mo>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>-</mo>
  <mi>2</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>

  <mo>+</mo>
  <mo>(</mo>
  <mo>-</mo>
  <mi>2</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>3</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>)</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>

  <mo>+</mo>
  <mo>(</mo>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>-</mo>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>)</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  
</math>


</p>







</div>

<div class="float25">
<a id="Vector_Gradient_From_Vector_Points"></a>
<h2>Vector Gradient From Vector Points</h2>
<p>Consider a curve with n points in vector space.
 The gradient is needed for interpolation formulas and
 can be calculated from the set of points.
</p>

<p>If the curve is closed let the index be under modulus n.</p>

<p>For unconnected end points</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>=</mo>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>&Delta;p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>n</mi><mo>-</mo><mi>1</mi></mrow>
  </msub>
  <mo>=</mo>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>n</mi><mo>-</mo><mi>1</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>n</mi><mo>-</mo><mi>2</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>&Delta;p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>n</mi><mo>-</mo><mi>1</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>
</math>

</p>

<p>There are many different ways of defining the gradient.</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>=</mo>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi><mo>-</mo><mi>1</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>&Delta;p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>0.5</mi>
  <mo>(</mo>

  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi><mo>-</mo><mi>1</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>&Delta;p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>

  <mo>+</mo>
  <mo>(</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi><mo>+</mo><mi>1</mi></mrow>
  </msub>
  <mo>-</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>&Delta;p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi><mo>+</mo><mi>1</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>



  <mo>)</mo>
</math>


</p>



</div>

<div class="float25">

<a id="Continuous_Surface_from_Curves"></a>
<h2>Continuous Surface from Curves</h2>

<p>Consider two curves in 3D space. Let both
 curves be parameterized in t from 0 to 1 to travel
 from the start of the curve to the finish.
</p>

<p>To construct a surface between the two points use
 the vector space interpolation between two corresponding
 points on the other curve.
</p>

<p>This is a generalized rectangle where two of the boundaries
 have fixed curves and the other two are results of the interpolation.
</p>

<p>Note that the fixed curve itself could have been generated from
 sample points and be built with splines.
</p>

<p>
While two sides are continuous the other two sides are not.
 When these have to be sown in the mesh could so easily have
 holes. I am just beginning to look at these issues.
</p>

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


</div>

<div class="float25">
<a id="Cubic_Interpolation_with_Barycentric_Coordinates"></a>
<h2>Cubic Interpolation with Barycentric Coordinates</h2>

<p>
This is something I cooked up after looking at
 <a href="#Cubic_Hermite_Interpolation_in_Vector_Space">
   Cubic Hermite Interpolation in Vector Space</a>
 and reading about <a href="g001.xml#Barycentric_Coordinates">
  Barycentric Coordinates</a>.
</p>

<p>First have a cubic multiplied by the point or its derivative.
  As the variable t goes to zero the approximation should not
 contribute then f(0)=0 and f'(0)=0 are the natural boundary
 conditions.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>0</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f'</mi>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>0</mi>
</math>

<br/>


<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>=</mo>
  <mi>a</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>b</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
</math>

</p>

<p>For the point p<sub>i</sub> it should be zero when the
 derivative is taken else 1.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>1</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f'</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>0</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>=</mo>
  <mo>-</mo> 
  <mi>2</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>3</mi>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
</math>

</p>


<p>For the point p'<sub>i</sub> it should be one when the
 derivative is taken else zero.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>0</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f'</mi>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <mo>=</mo>
  <mi>1</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>=</mo>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>-</mo>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
</math>

</p>

<p>With Barycentric coordinates it becomes the following
 interpolation.
</p>

<p class="equ">

<math xmlns="&mathml;">
  <mi>0</mi>
  <mo>&leq;</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>&leq;</mo>
  <mi>1</mi>
</math>

<br/>

<math xmlns="&mathml;">
  <mo>&Sum;</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>1</mi>
</math>

<br/>


<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>=</mo>
  <mi>&Sum;</mi>
  <mo>(</mo>
  <mo>-</mo>
  <mi>2</mi>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>3</mi>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>)</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>+</mo>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mi>3</mi></mrow>
  </msup>
  <mo>-</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msup>
  <mo>)</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>


</p>

<p>Note that how this formula was built is similar
 to how the cubic interpolation formula was built.  The main
 difference is that the cubic interpolation had point t=0 as
 a real point where I use it as a zero.  I am also sure
 that this is a known result (if it works, I have not tested
 it yet).
</p>

<p>Motivation for this comes from wanting to interpolate
 a simplex with a smooth surface. Also I am interested
 in the equivalent of taylor series in 3D.</p>

<p>This can be extended to a second order approximation
 with degree 5 having the boundary conditions f(0) = f'(0) 
 = f''(0) = 0 and the others specific to the point.
 For example f(1)=f'(1)=0 and f''(1)=1 with f*p''<sub>0</sub>.
</p>

<p class="equ">

<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>=</mo>
  <mi>&Sum;</mi>
  <mi>a</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>b</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>p'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
  <mi>p''</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>

</math>


</p>



</div>

<div class="spacer" />


<div class="float25">
<a id="Two_Point_Interpolation_Generalized"></a>

<h2>Two Point Interpolation Generalized </h2>

<p>The idea is very simple. First let the first K derivatives
 at the two points be known. Then given this information let each
 point be summed uniquely to give its own contribution to the
 interpolation function f. This must incorperate knowledge of the
 derivatives.
</p>

<p class="equ">
Let

<math xmlns="&mathml;">
  <mi>p</mi>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>
 be the first k derivatives of point. <br/>

<math xmlns="&mathml;">
  <mi>i</mi>
  <mo>=</mo>
  <mi>0</mi>
  <mi>...</mi>
  <mi>k</mi>
  <mo>-</mo>
  <mi>1</mi>
</math>
 where 
<math xmlns="&mathml;">
  <mi>i</mi>
  <mo>=</mo>
  <mi>0</mi>
</math>
 is the point in space.

</p>

<p>To fit k condtions requires k variables.</p>


<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <msubsup>
    <mo>&Sum;</mo>
    <mrow>
      <mi>i</mi><mo>=</mo><mi>0</mi>
    </mrow>
    <mrow>
      <mi>k</mi><mo>-</mo><mi>1</mi>
    </mrow>
  </msubsup>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msup>

</math>

<br/>

<math xmlns="&mathml;">
  <mi>p</mi>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
  <mo>=</mo>
  <mi>f</mi>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>

</p>
 

<p>Now consider the effect of summing each of the two points.  They would interfere
 with eachother.  So to cancel out the interference for the second point, we first
 have to say where the second point is. Naturally the second point is when 
<math xmlns="&mathml;">
  <mi>t</mi>
  <mo>=</mo>
  <mi>1</mi>
</math>.
 This doubles the number of conditions that need to be made. So reformatting
 the problem.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <msubsup>
    <mo>&Sum;</mo>
    <mrow>
      <mi>i</mi><mo>=</mo><mi>0</mi>
    </mrow>
    <mrow>
      <mi>2</mi><mi>k</mi><mo>-</mo><mi>1</mi>
    </mrow>
  </msubsup>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi><mi>i</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msup>

</math>

<br/>

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
  <mo>=</mo>
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>0</mi>
  <mo>=</mo>
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>

</p>

<p>Similarly for the second point 
<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
</math>
.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>t</mi>
  <mo>)</mo>
  <mo>=</mo>
  <msubsup>
    <mo>&Sum;</mo>
    <mrow>
      <mi>i</mi><mo>=</mo><mi>0</mi>
    </mrow>
    <mrow>
      <mi>2</mi><mi>k</mi><mo>-</mo><mi>1</mi>
    </mrow>
  </msubsup>
  <mi>c</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi><mi>i</mi></mrow>
  </msub>
  <mi>t</mi>
  <msup>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msup>

</math>

<br/>

<math xmlns="&mathml;">
  <mi>p</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
  <mo>=</mo>
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>1</mi>
  <mo>)</mo>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>0</mi>
  <mo>=</mo>
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>0</mi>
  <mo>)</mo>
  <msup>
    <mi></mi>
    <mrow><mo>(</mo><mi>i</mi><mo>)</mo></mrow>
  </msup>
</math>

</p>






</div>

<div class="spacer" />

<div class="float25">
<a id="Curve_Boundaries_on_3D_Triangle"></a>
<h2>Curve Boundaries on 3D Triangle</h2>

<p>
The idea is simple. Use symmetric splines on the
 boundaries of a triangle so that as the point moves
 on the surface towards one of these curves it converges
 to it.
</p>

<p>When on one of these boundaries the other point is
 non-existant.  Hence the mesh can be stiched so that
 two neighboring surfaces connect.
</p>

<p>Choose the boundary curve to be a cubic polynomial such that
 the first derivative is also satisfied at the points.
 So that the points of the triangle have C<sup>1</sup> continuity
 but the intersection curves on the boundary have C<sup>0</sup> continuity.
</p>

<p>While this may at first appear to be a compromise it is strategic.  
 For problems that I have
 the points are the ultimate sources of knowledge.  What is between
 the points is unknown. 
</p>

<p>Ofcourse the next stage would be to get C<sup>1</sup> at the boundary
 as well, I am really going to have to speak with someone who knows
 surfaces and their algebraic representations.  But what will probably
 happen is that I spend the next year teaching myself.
 Rational bicubic B-spline surfaces possess C<sup>2</sup> however they
 do not satisfy the boundary conditions at the points, if they can
 be made to do this and their boudary edges are also C<sup>2</sup>
 and the continuity could be generalized for any dimension I would be
 very happy (if I could do it). 
</p>

</div>

<div class="float25">

<p class="equ">
<math xmlns="&mathml;">
  <mi>k</mi>
  <mo>=</mo>
  <mi>i</mi>
  <mo>+</mo>
  <mi>1</mi>
  <mi>mod</mi>
  <mi>3</mi>
</math>
<br/>

<math xmlns="&mathml;">
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>=</mo>
  <mi>A</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>P</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>B</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>P'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>

  <mo>+</mo>

  <mi>C</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>P</mi>
  <msub>
    <mi></mi>
    <mrow><mi>k</mi></mrow>
  </msub>
  <mo>+</mo>
  <mi>D</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>P'</mi>
  <msub>
    <mi></mi>
    <mrow><mi>k</mi></mrow>
  </msub>
</math>

<br/>

<math xmlns="&mathml;">
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
 &nbsp; as <br/>
<math xmlns="&mathml;">
  <mi>A</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
, 
<math xmlns="&mathml;">
  <mi>B</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
,  
<math xmlns="&mathml;">
  <mi>C</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
, 
<math xmlns="&mathml;">
  <mi>D</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>(</mo>
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>)</mo>
</math>
.
</p>

<p>A point on the surface can be expresses as a sum of the
 functions.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>p</mi>
  <mo>=</mo>
  <msubsup>
    <mo>&Sum;</mo>
    <mrow>
      <mi>i</mi><mo>=</mo><mi>0</mi>
    </mrow>
    <mrow>
      <mi>2</mi>
    </mrow>
  </msubsup>
  <mi>f</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mi>w</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math> 
<br/>
where 

<math xmlns="&mathml;">
  <mi>w</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math> is the weight.
</p>

<p class="equ">
<math xmlns="&mathml;">
  <mi>w</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <mo>=</mo>

  <mfrac>
    <mrow>

  <mi>v</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>

    </mrow>
    <mrow>

  <mi>v</mi>
  <msub>
    <mi></mi>
    <mrow><mi>0</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>v</mi>
  <msub>
    <mi></mi>
    <mrow><mi>1</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>
  <mo>+</mo>
  <mi>v</mi>
  <msub>
    <mi></mi>
    <mrow><mi>2</mi></mrow>
  </msub>
  <msup>
    <mi></mi>
    <mrow><mo>-</mo><mi>1</mi></mrow>
  </msup>

    </mrow>
  </mfrac>

</math>


</p>


<p class="equ">
 Let 
<math xmlns="&mathml;">
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>
 be a point on the boundary. <br/>
 Let 
<math xmlns="&mathml;">
  <mi>v</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>
 be the minimum distance from a point
<math xmlns="&mathml;">
  <mi>q</mi>
</math>
 to 
<math xmlns="&mathml;">
  <mi>u</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>
 where 
<math xmlns="&mathml;">
  <mi>q</mi>
</math>
 is some point inside the triangle formed by
<math xmlns="&mathml;">
  <mi>P</mi>
  <msub>
    <mi></mi>
    <mrow><mi>i</mi></mrow>
  </msub>
</math>.

</p>

<p>Essentially the problem is given point q find point p.
 q exists in the triangle. Let q be the orthocenter and
 calculate v<sub>i</sub>. u<sub>i</sub> is the ratio of
 the two points on the boundary and since this function is
 symmetric u<sub>i</sub> is easily calculated. So together
 u<sub>i</sub> and v<sub>i</sub> form a local coordinate system.
</p>

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



</div>


<div class="float25">
<a id="References"></a>
<h2>References</h2>

<ol>

<li>
Tomas Akenine-Moller and Eric Haines (2002). Real-Time Rendering 2nd Edition.
 ISBN 1-56881-182-9
</li>


</ol>



</div>




</body>
</html>


