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

projection -- Orthogonal projection on a line

Synopsis

Description

Gives the orthogonal projection of p on the line defined by p1, p2.

i1 : circ=Circle{Radius=>10,"fill"=>"red","stroke"=>"black",Draggable=>true,TransformMatrix => translation [100,100]};
i2 : gList(Line{circ,projection(circ,vector{0,0},vector{0,1}),"stroke"=>"red"},Line{circ,projection(circ,vector{0,0},vector{1,0}),"stroke"=>"red"},circ,Axes=>true,Margin=>0.15)

o2 = GraphicsList{Axes => true                                                                                                        }
                  cache => CacheTable{}
                  Contents => {Line{cache => CacheTable{}                    }, Line{cache => CacheTable{}                    }, circ}
                                    Point1 => circ                                   Point1 => circ
                                    Point2 => projection (circ, | 0 |, | 0 |)        Point2 => projection (circ, | 0 |, | 1 |)
                                                                | 0 |  | 1 |                                     | 0 |  | 0 |
                                                                | 0 |  | 0 |                                     | 0 |  | 0 |
                                                                | 1 |  | 1 |                                     | 1 |  | 1 |
                                    style => MutableHashTable{...1...}               style => MutableHashTable{...1...}
                  Margin => .15
                  style => MutableHashTable{}

o2 : GraphicsList

Ways to use projection :

For the programmer

The object projection is a method function.