title: How Find angle in php when we know base perpendicular and hypotenuse?
body: <h3>Find angle in php when we know base perpendicular and hypotenuse ?</h3>
  
  <p>I am making a project in PHP and need me some calculations but i am unable to imagine how to find out the angle when know base perpendicular and hypotenuse</p>
  
  <p><img src="https://i.stack.imgur.com/zeFQy.jpg" alt="Find Angle"></p>
  
  <p>
  Here is:<br><b>AB = 3000 = BASE</b><br>
  <b>BC = 1000 = PERPENDICULAR<br>
  AC = find by me in php script as below</b></p>
  
  <h2>But here is i need the find out angle among the AB to AC or A°
  </h2>
  
  <blockquote>
    <p>Script for find <b>HYPOTENUSE</b> in PHP as below</p>
  </blockquote>
  
  <pre><code>&lt;?php 
  if(isset($_GET['f']) and ($_GET['t'])){
      $fr = $_GET['f'];
      $to = $_GET['t'];
      $xf = explode(', ',$fr);
      $xt = explode(', ',$to);
  
      $ans1   =   $xf[0]-$xt[0];
      $ans2   =   $xf[1]-$xt[1];
      $ans3   =   $ans1*$ans1;
      $ans4   =   $ans2*$ans2;
      $ans5   =   (sqrt($ans3+$ans4))*111.2;
  } else {
      $fr = $to = $ans5 = "";
  }
  ?&gt;
  
  
  
  
  &lt;form action="" method="GET"&gt;
  From:&lt;br&gt;
  &lt;input type="text" name="f" value="&lt;?php echo $fr; ?&gt;"&gt;&lt;/input&gt;
  &lt;p&gt;&lt;/p&gt;
  To:&lt;br&gt;
  &lt;input type="text" name="t" value="&lt;?php echo $to; ?&gt;"&gt;&lt;/input&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;button type="submit"&gt;CALCULATE&lt;/button&gt;
  &lt;/form&gt;
  &lt;hr&gt;
  &lt;div&gt;
  &lt;?php 
  echo 'Distance: &lt;strong&gt;'.round($ans5*1000, 2).'&lt;/strong&gt; meter(s)';
  echo ' or &lt;strong&gt;'.round(($ans5), 3).'&lt;/strong&gt; kilometer(s)&lt;br&gt;';
  echo 'Distance: &lt;strong&gt;'.round(($ans5*0.621371), 3).'&lt;/strong&gt; Mile(s)&lt;br&gt;';
  echo 'Distance: &lt;strong&gt;'.round(($ans5*1000*3.28084), 2).'&lt;/strong&gt; Foot';?&gt;
  &lt;/div&gt;
  &lt;hr&gt;
  </code></pre>