Design Scripting Documentation
     
 
     
  Ellipse from conjugate axes  
     
     
  Inputs:  
     
the conjugate axes va-vb and ua-ub of the ellipse
     
  Outputs:  
     
the center point and major and minor axes vectors
     
  Implementation
01  function ellipse_conjugate( va, vb, ua, ub )
02    dim u: u = vector_create( ua, ub )
03    dim v: v = vector_create( va, vb )
04    dim n: n = vector_cross( u, v )
05    dim w: w = vector_cross( v, n )
06    dim c: c = vertex_middle( va, vb )
07    dim h: h = vector_length( v ) / 2.0
08    dim r: r = vertex_translate( c, vector_rescale( w, h ) )
09    dim m: m = vertex_middle( ub, r )
10    dim s: s = vector_create( ub, r )
11    dim g: g = vertex_length( c, m )
12    dim p: p = vertex_translate( m, vector_rescale( s, g ) )
13    dim q: q = vertex_translate( m, vector_rescale( s,-g ) )
14    dim o: o = vertex_middle( c, ub )
15    dim i: i = vertex_length( c, vertex_translate( o, vector_create( p, o ) ) )
16    dim j: j = vertex_length( c, vertex_translate( o, vector_create( q, o ) ) )
17    ellipse_conjugate = array( c, _
18      vector_rescale( vector_create( c, q ), i ), _
19      vector_rescale( vector_create( c, p ), j )  _
20    )
21  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