論文的中心內容是:
重要點的判斷方式是基于垂直距離最大值,同樣和道格拉斯普克演算法有一個限定值,
分段程序也是基于第一個找出的點并由此遍歷的程序,
具體論文要搜索:基于序列重要點的時間序列分割
給出地址:https://www.docin.com/p-110929153.html
是我理解錯了嗎?怎么感覺和道格拉斯普克的演算法好像....
同樣是可以應用與折線圖的繪制,在大量點的情況下,繪制較為困難時可以用的演算法
截圖

關鍵幾個地方
public class SIP { public static double Distance(Point start, Point end, Point x) { double restult = Math.Abs(start.Y + (end.X - start.X) * ((x.X - start.X) / (end.X - start.X)) - x.Y); return restult; } public static void Segment(List<Point> list, int start, int end, double e, ref List<int> ns) { double maxvalue = https://www.cnblogs.com/T-ARF/archive/2021/04/05/0; int index = 0; for (int i = start; i < end; i++) { var val = Distance(list[start], list[end], list[i]); //和DP一樣的程序,具體計算不太一樣 if (val > maxvalue) { maxvalue = val; index = i; } } if (maxvalue > e && index != 0) { ns.Add(index); //遍歷添加 Segment(list, start, index, e, ref ns); Segment(list, index, end, e, ref ns); } } public static List<Point> BSIP(List<Point> list, double e) { List<Point> BSIPList = new List<Point>(); List<int> ns = new List<int>(); //默認添加首點和尾點 BSIPList.Add(list[0]); //遍歷分割 Segment(list, 0, list.Count - 1, e, ref ns); ns.Sort(); foreach (var item in ns) { BSIPList.Add(list[item]); } //默認添加首點和尾點 BSIPList.Add(list.Last()); return BSIPList; } }
源代碼地址
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/272731.html
標籤:.NET技术
