title: Find out the coordinates using slope and start point
body: <p>I am trying to achieve a task which is to resize the line after taking length input from user.So what I have currently is old length,old points(P1 ,P2) and have to find the new P2 after taking new length from user.I am here pasting code which I have tried to resize line using slope but its not working.I am totally new in canvas part to any kind of search hint will also be appreciable.Thanks in advance.</p>
  
  <p><strong>Method to find out the angle between previous points</strong>:</p>
  
  <pre><code>public double calculateAngle(){
    if(selectedShape!=null){      
    InnWall shape  = (InnWall)selectedShape;
      if(shape!=null)
      return calAngle(shape.y2-shape.y1, shape.x2-shape.x1);
    }
  return -1;
  }
  </code></pre>
  
  <p><strong>Method to find out he coordinates</strong></p>
  
  <pre><code>public void calCoordinates(double length){
  
          InnWall shape  = (InnWall)selectedShape;
          if(shape!=null){
              double angle = calculateAngle();
          Log.e(TAG, "cal angle"+(int)calculateAngle());
          Log.e(TAG, "cal length"+(int)length);
          Log.e(TAG, "x coodinatee"+shape.x1+length*Math.cos(angle));
          Log.e(TAG, "y coodinatee"+shape.y1+length*Math.sin(angle));
          shape.x2=(float)(shape.x1+length*Math.cos(angle));
          shape.y2=(float)(shape.y1+length*Math.sin(angle));
  
  }
  
  private  double calAngle(double dy,double dx){
          return double compassBearing=dy/dx;
  }
  </code></pre>