public PlaPointInt orthogonal_projection(PlaPointInt p_other){
  PlaPointInt result;
  int horizontal_distance=Math.abs(this.v_x - p_other.v_x);
  int vertical_distance=Math.abs(this.v_y - p_other.v_y);
  if (horizontal_distance <= vertical_distance) {
    result=new PlaPointInt(p_other.v_x,this.v_y);
  }
 else {
    result=new PlaPointInt(this.v_x,p_other.v_y);
  }
  return result;
}

public PlaPointInt orthogonal_projection ( PlaPointInt p_other ) { PlaPointInt result ; int horizontal_distance = Math . abs ( this . v_x - p_other . v_x ) ; int vertical_distance = Math . abs ( this . v_y - p_other . v_y ) ; if ( horizontal_distance <= vertical_distance ) { result = new PlaPointInt ( p_other . v_x , this . v_y ) ; } else { result = new PlaPointInt ( this . v_x , p_other . v_y ) ; } return result ; }
calculates the nearest point to this point on the horizontal or vertical line through p_other ( snaps this point to on ortogonal line through p_other ) .
