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

place -- Position a point relative to two other points

Synopsis

Description

Gives a point situated at position a along the line (p1,p2) in units where they are at distance 1, and at position b orthogonally to it. Only makes sense in 2d.

i1 : (p1,p2)=apply(([-1,-1],[1,1]),coord -> gNode(coord,Circle{Radius=>0.1,"fill"=>"red","stroke"=>"black"},Draggable=>true));
i2 : gList(Polygon{{p1,place(p1,p2,0.7,0.3),p2,place(p1,p2,0.7,-0.3)}},p1,p2)

o2 = GraphicsList{cache => CacheTable{}                                                                                                                                                                                                  }
                  Contents => {Polygon{cache => CacheTable{}                                                                                                                                                                   }, p1, p2}
                                       PointList => {GraphicsCoordinate p1, place (GraphicsCoordinate p1, GraphicsCoordinate p2, .7, .3), GraphicsCoordinate p2, place (GraphicsCoordinate p1, GraphicsCoordinate p2, .7, -.3)}
                                       style => MutableHashTable{}
                  style => MutableHashTable{}

o2 : GraphicsList

For the programmer

The object place is a function closure.