Exemplo n.º 1
0
        public ThrowSummary GetThrowSummary(double _xCoord, double _yCoord)
        {
            var point = new NormalizedPoint();

            point.xCoord = _xCoord;
            point.yCoord = _yCoord;
            return(GetThrowSummary(point));
        }
Exemplo n.º 2
0
        public int GetPoints(NormalizedPoint _point)
        {
            var distance = DistanceToCenter(_point);

            if (distance > 1.0)
            {
                return(0);
            }

            var multiplicator = GetDistanceMultiplicator(distance).multiplicator;

            return(multiplicator >= 25 ? multiplicator : multiplicator *GetPointsForAngle(GetAngle(_point)).points);
        }
Exemplo n.º 3
0
 public bool HitTheBoard(NormalizedPoint _point)
 {
     return(DistanceToCenter(_point) < 1.0);
 }
Exemplo n.º 4
0
 public double DistanceToCenter(NormalizedPoint _point)
 {
     return(Math.Sqrt((_point.xCoord * _point.xCoord) + (_point.yCoord * _point.yCoord)));
 }
Exemplo n.º 5
0
 public ThrowSummary GetThrowSummary(NormalizedPoint _point)
 {
     return(new ThrowSummary(_point.xCoord, _point.yCoord, DistanceToCenter(_point), HitTheBoard(_point),
                             GetDistanceMultiplicator(DistanceToCenter(_point)).multiplicator,
                             GetAngle(_point), GetPointsForAngle(GetAngle(_point)).points, GetPoints(_point)));
 }
Exemplo n.º 6
0
        public double GetAngle(NormalizedPoint _point)
        {
            var preVal = GetAtanInDegrees(_point);

            return(preVal < 0.0 ? 360 + preVal : preVal);
        }
Exemplo n.º 7
0
 public double GetAtanInDegrees(NormalizedPoint _point)
 {
     return(GetAtanInRads(_point) * (180.0 / System.Math.PI));
 }
Exemplo n.º 8
0
 public double GetAtanInRads(NormalizedPoint _point)
 {
     return(Math.Atan2(GetSin(_point), GetCos(_point)));
 }
Exemplo n.º 9
0
 public double GetCos(NormalizedPoint _point)
 {
     return(ZeroDegreeHorizonVector().xCoord + _point.xCoord + ZeroDegreeHorizonVector().yCoord + _point.yCoord);
 }
Exemplo n.º 10
0
 public double GetSin(NormalizedPoint _point)
 {
     return(ZeroDegreeHorizonVector().xCoord *_point.yCoord - _point.xCoord * ZeroDegreeHorizonVector().yCoord);
 }