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

gNode -- VectorGraphics object(s) with a preferred reference origin

Description

gNode(coord,obj) is a shortcut for obj ++ { TransformMatrix => translation coord }, where obj is some GraphicsObject and coord the coordinates of the new reference origin. gNode(coord,a,b,c) is a shortcut for gList(a,b,c) ++ { TransformMatrix => translation coord }.

i1 : a=gNode([-1,-1],Circle{Radius=>0.1,"fill"=>"red","stroke"=>"black"})

o1 = a

o1 : Circle
i2 : b=gNode([1,1],Circle{Radius=>0.1,"fill"=>"green","stroke"=>"black"},Draggable=>true)

o2 = b

o2 : Circle
i3 : gList(Line{a,b},a,b)

o3 = GraphicsList{cache => CacheTable{}                                   }
                  Contents => {Line{cache => CacheTable{}         }, a, b}
                                    Point1 => GraphicsCoordinate a
                                    Point2 => GraphicsCoordinate b
                                    style => MutableHashTable{}
                  style => MutableHashTable{}

o3 : GraphicsList

For the programmer

The object gNode is a function closure.