Previous Up Next

27.3.4  Finding the intersection points of two objects in space

See Section 26.5.7 for points of intersection of objects in the plane.

The inter command finds the intersection of two geometric objects in ℝ3.

Examples

LA:=inter(plane(point(0,1,1),point(1,0,1),point(1,1,0)),line(point(0,0,0),point(1,1,1))):; coordinates(LA)
     






2
3
,
2
3
,
2
3






          
LB:=inter(sphere(point(0,0,0),1),line(point(0,0,0),point(1,1,1))):; coordinates(LB)
     






3
3
,
3
3
,
3
3



,


3
3
,−
3
3
,−
3
3






          

To get just one of the points, use the usual list indices.

coordinates(LB[0])
     



3
3
,
3
3
,
3
3



          

To get the point closest to (1/2,1/2,1/2):

LB1:=inter(sphere(point(0,0,0),1),line(point(0,0,0),point(1,1,1)),point(1/2,1/2,1/2)):; coordinates(LB1)
     



3
3
,
3
3
,
3
3



          

Previous Up Next