Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
  
<table class="ADM" ng-app="ADMApp">
  <tr class="ADM-header">
    <th class="ADM-header">WE NEED TO FIND</th>
    <th class="ADM-header">Image Height</th>
    <th class="ADM-header">Vertical Pixels</th>
    <th class="ADM-header">Farthest Viewer</th>
    <th class="ADM-header">Viewing Ratio</th>
  </tr>
  <tr ng-controller="ADMFarViewController as view">
    <td class="ADM-header">
      Farthest Viewer
    </td>
    <td class="ADM-cell">
      <input size="5" 
             ng-model="view.ADMFarViewImgHeightvar" 
             ng-keyup="view.ADMCalc()" />
    </td>
    <td class="ADM-cell">
      <input size="5" 
             ng-model="view.ADMFarViewVertPixvar" 
             ng-keyup="view.ADMCalc()" />
    </td>
    <td class="ADM-cell">
      {{ view.ADM_FarViewFarthestViewer_ans }}
    </td>
    <td class="ADM-cell">
      {{ view.ADM_FarViewViewRat_ans }}
    </td>
  </tr>
</table>   
</body>
</html>
 
angular.module('ADMApp', [])
  .controller('ADMFarViewController', [function() {
    var ctrl = this;
    ctrl.ADMCalc = function() {
      var ADMFarViewImgHeightvar = Number(ctrl.ADMFarViewImgHeightvar || 0);
      var ADMFarViewVertPixvar = Number(ctrl.ADMFarViewVertPixvar || 0);
      ctrl.ADM_FarViewFarthestViewer_ans = (ADMFarViewImgHeightvar * 3438) / ADMFarViewVertPixvar;
      ctrl.ADM_FarViewViewRat_ans = ctrl.ADM_FarViewFarthestViewer_ans / ADMFarViewImgHeightvar;
    }
}]);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
bennettatomspro
0viewers