Returns the location of the intersection of the two lines (p1,p2) and (q1,q2)
i1 : circ=Circle{Radius=>0.05,"fill"=>"green","stroke"=>"black","stroke-width"=>0.01,Size=>2}; |
i2 : (a,b,c,d)=apply(1..4,i -> gNode([random RR,random RR],circ,Draggable=>true)) o2 = (a, b, c, d) o2 : Sequence |
i3 : gList(Line{a,b},Line{c,d},Circle{crossing(a,b,c,d),Radius=>0.05,"fill"=>"blue"},a,b,c,d) o3 = GraphicsList{cache => CacheTable{} } Contents => {Line{cache => CacheTable{} }, Line{cache => CacheTable{} }, Circle{cache => CacheTable{} }, a, b, c, d} Point1 => GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*- } Point1 => GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*- } Center => GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:262:25-262:97]*- } RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*- RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*- RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:261:33-261:107]*- Point2 => GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*- } Point2 => GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*- } Radius => .05 RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*- RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*- style => MutableHashTable{...1...} style => MutableHashTable{} style => MutableHashTable{} style => MutableHashTable{} o3 : GraphicsList |
In 3d, the behavior is undetermined if the lines do not intersect.
The object crossing is a method function.