gdc-broken_edge.cc
changeset 189 8b69c54d5bf0
parent 174 95872af46fc4
child 194 6b2b718420eb
equal deleted inserted replaced
6:b2176f8099aa 7:fb65a7ea9411
    91   XY center(ms.arrow_pos[edge]);
    91   XY center(ms.arrow_pos[edge]);
    92 
    92 
    93   XY unit_vector_in_dir(head-center);
    93   XY unit_vector_in_dir(head-center);
    94   double length=sqrt( unit_vector_in_dir.normSquare() );
    94   double length=sqrt( unit_vector_in_dir.normSquare() );
    95 
    95 
    96   unit_vector_in_dir/=length;
    96   if(length!=0)
       
    97     {
       
    98       unit_vector_in_dir/=length;
       
    99     }
    97 
   100 
    98   // update the arrow
   101   // update the arrow
    99   drawArrow(unit_vector_in_dir);
   102   drawArrow(unit_vector_in_dir);
   100 
   103 
   101   // update the edge
   104   // update the edge