examples/3d/js/camera.js
function(height, angle, dist) {
    var z = dist * Math.cos(angle);
    var wallH = this.height * height / z;
    var bottom = this.height / 2 * (1 + 1 / z);

    return {
      top: bottom - wallH,
      height: wallH
    };
  }
function(height, angle, dist) {
    var z = dist * Math.cos(angle);
    var wallH = this.height * height / z;
    var bottom = this.height / 2 * (1 + 1 / z);

    return {
      top: bottom - wallH,
      height: wallH
    };
  }
function ( height , angle , dist ) { var z = dist * Math . cos ( angle ) ; var wallH = this . height * height / z ; var bottom = this . height / 2 * ( 1 + 1 / z ) ; return { top : bottom - wallH , height : wallH } ; }
Based on the angle and distance, determine how we are going to project the image.
@param  {Number} height Wall piece height.
@param  {Number} angle  Angle of the ray.
@param  {Number} dist   Distnace from the player.
@return {Object}        top and height
Based on the angle and distance determine how we are going to project the image .