public PlaSegmentFloat shrink_segment(double p_offset){
  double dx=point_b.v_x - point_a.v_x;
  double dy=point_b.v_y - point_a.v_y;
  if (dx == 0 && dy == 0)   return this;
  double length=Math.sqrt(dx * dx + dy * dy);
  double offset=Math.min(p_offset,length / 2);
  PlaPointFloat new_a=new PlaPointFloat(point_a.v_x + (dx * offset) / length,point_a.v_y + (dy * offset) / length);
  double new_length=length - offset;
  PlaPointFloat new_b=new PlaPointFloat(point_a.v_x + (dx * new_length) / length,point_a.v_y + (dy * new_length) / length);
  return new PlaSegmentFloat(new_a,new_b);
}

public PlaSegmentFloat shrink_segment ( double p_offset ) { double dx = point_b . v_x - point_a . v_x ; double dy = point_b . v_y - point_a . v_y ; if ( dx == 0 && dy == 0 ) return this ; double length = Math . sqrt ( dx * dx + dy * dy ) ; double offset = Math . min ( p_offset , length / 2 ) ; PlaPointFloat new_a = new PlaPointFloat ( point_a . v_x + ( dx * offset ) / length , point_a . v_y + ( dy * offset ) / length ) ; double new_length = length - offset ; PlaPointFloat new_b = new PlaPointFloat ( point_a . v_x + ( dx * new_length ) / length , point_a . v_y + ( dy * new_length ) / length ) ; return new PlaSegmentFloat ( new_a , new_b ) ; }
shrinks this line on both sides by p_value . the result will contain at least the gravity point of the line .
