Example #1
0
        public static double EndDirection(this Stroke stroke, int diffIdx)
        {
            PointSection sect = new PointSection(stroke[Math.Max(0, stroke.Count - 1 - diffIdx)].Pos,
                                                 stroke[stroke.Count - 1].Pos);

            return(sect.Direction());
        }
Example #2
0
        public static double Direction(this PointSection section)
        {
            double dx = (double)(section.End.X - section.Start.X);
            double dy = (double)(section.End.Y - section.Start.Y);

            return(Math.Atan2(dy, dx));
        }
Example #3
0
        public static double StartDirection(this Stroke stroke, int diffIdx)
        {
            PointSection sect = new PointSection(stroke.Start.Pos, stroke[Math.Min(stroke.Count - 1, diffIdx)].Pos);

            return(sect.Direction());
        }