next | previous | forward | backward | up | top | index | toc | packages | Macaulay2 website
VectorGraphics :: crossing

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 => a                        Point1 => c                          Center => crossing (a, b, c, d)
                                    Point2 => b                        Point2 => 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.