Design Scripting Documentation
     
 
     
  Intersection Line Plane  
     
     
  Inputs:  
     
three points of a plane, two points of a line
     
  Outputs:  
     
a number -> parallelism -> distance line plane
a vertex -> intersection -> point of intersection
     
  Implementation
01  function intersect_lineplane( va, vb, vc, ua, ub )
02    dim u: u = vector_create( vb, va )
03    dim v: v = vector_create( vc, va )
04    dim n: n = vector_normalize( vector_cross( u, v ) )
05    dim w: w = vector_normalize( vector_create( ua, ub ) )
06    dim y: y = vector_create( ua, va )
07    dim p: p = vector_dot( n, w )
08    dim q: q = vector_dot( n, y )
09    if( abs( p ) <= NUMBER_ZERO ) then
10      intersect_lineplane = vertex_length( ua, vertex_flatten( va, vb, vc, ua ) )
11    else
12      intersect_lineplane = vertex_translate( ua, vector_scale( w, q / p ) )
13    end if
14  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