/* -*-ePiX-*- */
#include "epix.h"
using namespace ePiX;

void Map(const P& tail, const P& head, double dt = 0.1)
{
  P dir(head - tail);
  arrow(tail + dt*dir, head - dt*dir);
}

int main()
{
  picture(P(0, 0), P(2, 2), "1.25 x 1.25in");

  begin();
  arrow_width(5);
  arrow_ratio(2);
  arrow_inset(0.75);

  P Pa(0, 2), Pb(2, 2), Pc(2, 1), Pd(0, 1), Pe(1, 0.25);

  dot(Pa, P(-2, 2), "$a$", tl);
  dot(Pb, P( 2, 2), "$b$", tr);
  dot(Pc, P( 2,-4), "$c$", br);
  dot(Pd, P(-2,-4), "$d$", bl);
  dot(Pe);

  bold();
  Map(Pa, Pb);
  Map(Pa, Pc);
  Map(Pa, Pd);

  Map(Pb, Pc);
  Map(Pd, Pc);

  Map(Pc, Pe);
  Map(Pd, Pe);

  tikz_format();
  end();
}
