Macaulay2 » Documentation
Packages » VectorGraphics :: crossing
next | previous | forward | backward | up | index | toc

crossing -- Intersection of two lines

Synopsis

Description

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 a        Point1 => GraphicsCoordinate c          Center => crossing (GraphicsCoordinate a, GraphicsCoordinate b, GraphicsCoordinate c, GraphicsCoordinate d)
                                    Point2 => GraphicsCoordinate b        Point2 => GraphicsCoordinate d          Radius => .05
                                    style => MutableHashTable{}           style => MutableHashTable{}             style => MutableHashTable{...1...}
                  style => MutableHashTable{}

o3 : GraphicsList

Caveat

In 3d, the behavior is undetermined if the lines do not intersect.

Ways to use crossing :

For the programmer

The object crossing is a method function.