Esempio n. 1
0
        protected List <List <double> > CalculateDeltas(List <PointPositionsList> points)
        {
            List <List <double> > deltas = new List <List <double> >();
            PointPositionsList    nPoints;

            for (var pointNumber = 0; pointNumber < points.Count; ++pointNumber)
            {
                nPoints = points[pointNumber];
                PointPositionsList.Position prevPoint = null;
                double delta;
                nPoints.ForEach(point =>
                {
                    if (deltas.Count <= pointNumber)
                    {
                        deltas.Add(new List <double>());
                    }

                    if (prevPoint != null)
                    {
                        delta = GetDelta(point, prevPoint);
                        deltas[pointNumber].Add(delta);
                    }
                    prevPoint = point;
                });
            }
            return(deltas);
        }
Esempio n. 2
0
        protected double GetDelta(PointPositionsList.Position p1, PointPositionsList.Position p2)
        {
            var xd = p1.X - p2.X;
            var yd = p1.Y - p2.Y;
            var zd = p1.Z - p2.Z;

            return(Math.Sqrt((xd * xd) + (yd * yd) + (zd * zd)));
        }