Action:
|
Returns TRUE if two lines intersect.
|
|
Filename:
|
kern/kern_scm/law_scm.cxx
|
|
Syntax:
|
(law:line-line-interset point1 gvector1 point2 gvector2)
|
|
Arg Types:
|
point1
|
position
|
|
gvector1
|
gvector
|
|
point2
|
position
|
|
gvector2
|
gvector
|
|
Returns:
|
boolean
|
|
Description:
|
Returns TRUE if the line given by
point1 + t * gvector1 intersects the line
point2 + s * gvector2. Also prints out the parameter values of the two nearest nearest points.
|
|
|
point1 specifies a position on the first line.
|
|
|
gvector1 specifies the direction of the first line.
|
|
|
point2 specifies a position on the second line.
|
|
|
gvector2 specifies the direction of the second line.
|
|
Example:
|
; law:line-line-intersect
|
|
; Create a cylinder
|
|
; intersect at (1 2 3)
|
|
(law:line-line-intersect (position 4 4 4)
|
|
|
(gvector 3 2 1) (position 1 10 3)
|
|
|
(gvector 0 -.3 0))
|
|
; Lines intersect at (1.000000 2.000000
|
|
;
|
|
3.000000)
|
|
; Param values are:
|
|
;
|
|
param0 at -1.000000
|
|
;
|
|
param1 at 26.666667
|
|
;; #t
|
|
; no intersection
|
|
(law:line-line-intersect (position 5 4 4)
|
|
|
(gvector 3 2 1) (position 3 10 1)
|
|
|
(gvector 0 -.3 0))
|
|
; Param values are:
|
|
;
|
|
param0 at -0.900000
|
|
;
|
|
param1 at 26.000000
|
|
;; #f
|