# Singular

#### D.13.1.15 convexIntersection

Procedure from library `gfan.lib` (see gfan_lib).

Usage:
convexIntersection(c1,c2); c1 cone, c2 cone
convexIntersection(c1,p1); c1 cone, p1 polytope
convexIntersection(p1,c1); p1 cone, c1 polytope
convexIntersection(p1,p2); p1 polytope, p2 polytope

Return:
cone resp polytope, the convex hull of its two input objects

Example:
 ```LIB "gfan.lib"; intmat M1[2][2]= 1,0, 0,1; cone c1=coneViaPoints(M1); intmat M2[2][2]= 1,1, 1,-1; cone c2=coneViaPoints(M2); intmat M3[2][2]= 1,0, 0,-1; cone c3=coneViaPoints(M3); cone c12=convexIntersection(c1,c2); c12; ==> AMBIENT_DIM ==> 2 ==> FACETS ==> 0, 1, ==> 1,-1 ==> LINEAR_SPAN ==> ==> print(rays(c12)); ==> 1,0, ==> 1,1 cone c23=convexIntersection(c2,c3); c23; ==> AMBIENT_DIM ==> 2 ==> FACETS ==> 0,-1, ==> 1, 1 ==> LINEAR_SPAN ==> ==> print(rays(c23)); ==> 1, 0, ==> 1,-1 cone c13=convexIntersection(c1,c3); c13; ==> AMBIENT_DIM ==> 2 ==> FACETS ==> 1,0 ==> LINEAR_SPAN ==> 0,1 ==> print(rays(c13)); ==> 1,0 ```