2
$\begingroup$

Given that I have the array of points,

{{680*4, 509*4}, {739*4, 622*4}, {644*4, 741*4}, {606*4, 
  856*4}, {749*4, 474*4}, {977*4, 542*4}, {601*4, 481*4}, {584*4, 
  604*4}, {866*4, 667*4}}

what would be the best way to draw all the possible lines between this set of points and overlay them onto an image?

$\endgroup$
  • 1
    $\begingroup$ Graphics@Line@Subsets[#, {2}] &@ array and then use Show to cobine it with image. $\endgroup$ – Kuba Jan 21 '15 at 12:26
  • 1
    $\begingroup$ @Kuba straightforward, but why not answer? $\endgroup$ – Yves Klett Jan 21 '15 at 12:27
  • $\begingroup$ @Kuba Is there a place where I can learn to use this kind of shorthand? ATM I am unsure of the correct method to parse this kind of code. $\endgroup$ – March Ho Jan 21 '15 at 12:28
  • 1
    $\begingroup$ @MarchHo Here ;) common pitfalls $\endgroup$ – Kuba Jan 21 '15 at 12:31
  • $\begingroup$ @YvesKlett ok, done. :) $\endgroup$ – Kuba Jan 21 '15 at 12:37
8
$\begingroup$
array = {{680*4, 509*4}, {739*4, 622*4}, {644*4, 741*4}, {606*4, 
   856*4}, {749*4, 474*4}, {977*4, 542*4}, {601*4, 481*4}, {584*4, 
   604*4}, {866*4, 667*4}};

pic = ImageResize[ExampleData[{"TestImage", "Lena"}], {4000}];


Show[{
  pic,
  Graphics[{Yellow, Line@Subsets[array, {2}] }]
  }, ImageSize -> 400]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.