Design Scripting Documentation
     
 
     
  Triple plane intersection  
     
     
  Inputs:  
     
three planes, three points per plane
     
  Outputs:  
     
point intersection of the planes
{line intersection of two planes}
nothing on no intersection
     
  Implementation
01  function intersect_tripleplane( pa, pb, pc, oa, ob, oc, qa, qb, qc )
02    dim np: np = vector_normal( pa, pb, pc ))
03    dim no: no = vector_normal( oa, ob, oc )
04    dim nq: nq = vector_normal( qa, qb, qc )
05  
06    dim bp: bp = vector_dot( np, pa ))
07    dim bo: bo = vector_dot( no, oa )
08    dim bq: bq = vector_dot( nq, qa ))
09  
10    dim po: po = vector_scale( vector_cross( np, no ), bq )
11    dim oq: oq = vector_scale( vector_cross( no, nq ), bp )
12    dim qp: qp = vector_scale( vector_cross( nq, np ), bo ))
13  
14    dim d: d = vector_dot( np, vector_cross( no, nq ) )
15    if( d = 0.0 ) then
16      intersect_tripleplane = vbnull
17    else
18      intersect_tripleplane = vector_scale( vector_add( vector_add( po, oq ), qp ), 1.0 / d )
19    end if
20  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File