private List FilterBlocksByVelocityVector(List blocks) { List remainBlocks = new List(); var vector1 = _averageRockfallPathVector; blocks.ForEach(block => { var vector2 = new Vector3(block.VelXEst, block.VelYEst, block.VelZEst); var dotProduct = Vector3.Dot(vector1, vector2); var magnitude1 = vector1.Length(); var magnitude2 = vector2.Length(); var angle = Math.Acos(dotProduct / (magnitude1 * magnitude2)); var angleDeg = (180 * angle / Math.PI); block.VelocityVectorAngle = angleDeg; // not pass if (angleDeg >= _rockfallDetectionConfiguration.VelocityVectorFilter.MaxVelocityAngle) { block.FilteredOutByVectorVelocity = true; } // pass else { remainBlocks.Add(block); } }); //return remainBlocks; return blocks; }