1 publicstaticclassCommon2 {3 ///4 ///获取两个向量的夹角5 ///6 ///源向量7 ///目标向量8 ///9 publicstaticdoubleGetAngle(PlaneVector sourcePlaneVector, PlaneVector destPlaneVector)10 {11 doubletemp=0;12 doublenorm1=0;13 doublenorm2=0;14 15 norm1=System.Math.Sqrt(sourcePlaneVector.X*sourcePlaneVector.X+sourcePlaneVector.Y*sourcePlaneVector.Y);16 norm2=System.Math.Sqrt(destPlaneVector.X*destPlaneVector.X+destPlaneVector.Y*destPlaneVector.Y);17 18 temp=sourcePlaneVector.X*destPlaneVector.X+sourcePlaneVector.Y*destPlaneVector.Y;19 20 if(norm1==0||norm2==0)21 {22 return0;23 }24 else25 {26 temp=temp/(norm1*norm2);27 28 if(temp>1.0)29 {30 temp=1.0;31 }32 elseif(temp42 ///获取一个点在一个点集合中的最远点43 ///44 ///点45 ///点集合46 ///最远点47 publicstaticSystem.Drawing.PointF GetFarthestPointF(System.Drawing.PointF aPointF, ListaPoints)48 {49 if(aPointF==null)50 {51 thrownewArgumentNullException("aPointF");52 }53 54 if(aPoints==null)55 {56 thrownewArgumentNullException("aPoints");57 }58 59 System.Drawing.PointF farthestPointF=System.Drawing.PointF.Empty;60 61 doublemaxLength=0;62 doubletempLength=0;63 64 doublex=0;65 doubley=0;66 67 foreach(System.Drawing.PointF aDestPointinaPoints)68 {69 x=(double)(aDestPoint.X-aPointF.X);70 y=(double)(aDestPoint.Y-aPointF.Y);71 72 tempLength=Math.Sqrt(x*x+y*y);73 74 if(maxLength85 ///获取离散点集的边界点86 ///87 ///一组离散点88 ///离散点的边界点89 publicstaticListGetBorderPointFs(ListaPoints)90 {91 ListaBorderPoints=newList();92 93 if(aPoints==null)94 {95 thrownewArgumentNullException("aPoints");96 }97 98 if(aPoints.Count<3)99 {100 aBorderPoints.AddRange(aPoints);101 102 returnaBorderPoints;103 }104 105 //1.获取任意点的最远点106 107 System.Drawing.PointF farthestPointF=GetFarthestPointF(aPoints.First(), aPoints);108 109 //2.获取边界点 --------------------------------------->110 111 System.Drawing.PointF sourcePointF=farthestPointF;112 System.Drawing.PointF destPointF=aPoints.First();113 114 System.Drawing.PointF maxAnglePoint=System.Drawing.PointF.Empty;115 116 while(!farthestPointF.Equals(maxAnglePoint))117 {118 PlaneVector sourcePlaneVector=newPlaneVector(destPointF, sourcePointF);119 120 doublemaxAngle=0;121 122 foreach(System.Drawing.PointF aDestPointinaPoints)123 {124 PlaneVector destPlaneVector=newPlaneVector(aDestPoint, sourcePointF);125 126 doubletempAngle=GetAngle(sourcePlaneVector, destPlaneVector);127 128 if(maxAngle<=tempAngle)129 {130 maxAngle=tempAngle;131 maxAnglePoint=aDestPoint;132 }133 }134 135 aBorderPoints.Add(maxAnglePoint);136 137 destPointF=sourcePointF;138 sourcePointF=maxAnglePoint;139 140 141 }//---------------------------------------

python散点图获取边界_获取离散点的边界点相关推荐

  1. python散点图获取边界_将曲线拟合到散点图的边界

    Vlas Sokolov.. 8 我发现问题真的很有趣,所以我决定尝试一下.我不知道pythonic或natural,但我认为我已经找到了一种更准确的方法,可以在使用每个点的信息时将边缘拟合到像你这样 ...

  2. python处理期货数据_获取和讯期货数据(Python版本)

    获取和讯期货数据(Python版本) 获取和讯期货数据(Python版本) Author: edwardgyw, Date: 2016-11-28 14:38:44 Tags: Python 扩展 商 ...

  3. python 获取国内期货_获取和讯期货数据(Python版本).md

    > 策略名称 获取和讯期货数据(Python版本) > 策略作者 edwardgyw > 策略描述 数狂很早之前写了个js版本的第三方数据获取,我照着他的改写了个python版本的, ...

  4. python读取数据库绘图_获取博客积分排名,存入数据库,读取数据进行绘图(python,selenium,matplotlib)...

    该脚本的目的:获取博客的排名和积分,将抓取时间,排名,积分存入数据库,然后把最近的积分和排名信息进行绘图,查看积分或者排名的变化情况. 整个脚本的流程:是利用python3来编写,利用selnium获 ...

  5. python绑定电脑机器码_获取电脑硬件信息可破VMP SE WinLicense绑定机器码

    写到文件 (取运行目录 () + "\硬件信息.txt", 到字节集 (编辑框1.内容)) 置剪辑板文本 (编辑框1.内容) 信息框 ("已经复制硬件信息,目录也生成一个 ...

  6. Python 散点图线性拟合_简单线性回归——相关性分析

    一.名词解释. 不同变量相关关系的机器学习算法--简单线性回归算法. 散点图可以表示两个变量之间的相关性. 回归分析:能让我们进一步用更精确的话来描述出两个变量之间的线性相关性. 二.线性相关计算方法 ...

  7. easyui onclickrow 中获取列名_获取Chrome浏览器历史浏览记录实例

    1.获取谷歌浏览器浏览历史保存位置,并拷贝一份到操作目录下2.找到浏览记录文件 "History"3.将"History"文件导出到其他目录下4.查看数据库ta ...

  8. java获取长度_获取java长度

    Java获取本机MAC地址 为什么写这个呢?因为前几天看见网上有采用windows命令获取局域网和广域网MAC,查了查可以直接用JDK的方法. MAC可用于局域网验证,提高安全性. import ja ...

  9. python散点图密度颜色_关于matplotlib:Python散点图:如何使用与colorcycle具有相同颜色的色图...

    我正在尝试为散点图中的群集着色,并且使用两种不同的方法进行管理. 在第一个中,我迭代绘制每个群集,在第二个中,我一次绘制所有数据,并根据它们的标签[0.1.2.3.4]为其着色. 我对进入exampl ...

  10. java pid 获取句柄_获取进程pid、根据进程pid获取线程pid、获取线程进程句柄

    ======================================= 获取进程pid ======================================= #include &qu ...

最新文章

  1. 专访北京飞搜科技:一个创业公司该怎样在人工智能大潮中成长
  2. Office中如何实现公式颜色的更改?
  3. IIS不能下载.apk文件
  4. zabbix之使用proxy实现分布式监控
  5. 如何在大多数文字编辑器中(包括word和一些程序编辑器中)不要使用鼠标(即用快捷键)复制上一行到下一行
  6. php usort strcmp,字符串函数演示和usort()进行二维数组排序(0827)
  7. 如何还原桌面图标_如何为Windows 10桌面图标还原或更改文本的默认外观?
  8. ISAPI_Rewrite 规则说明
  9. 1118. Birds in Forest (25)
  10. [MySQL Reference Manual] 24 MySQL sys框架
  11. web前端基础(12js基础介绍)
  12. php dao 接口,SSH中公共Dao层、Dao接口
  13. Java 8 Strem基本操作
  14. opendrive中的Lanes
  15. 房间内人群疏散的python简单模拟
  16. winform中当laber标签字段过长时
  17. 美团开店宝Android pad,美团开店宝(com.sankuai.meituan.merchant) - 9.2.1 - 应用 - 酷安
  18. Unity-黑暗之魂复刻-跳跃功能
  19. mysql 1677_MySQL之数据库主从复制配置报错Last_Errno: 1677
  20. android启动百度地图应用并开始导航,android打开外部地图导航(百度、高德、腾讯)...

热门文章

  1. Tomcat怎么重启 tomcat重启命令
  2. 小米游戏本2019 I7-9750H安装黑苹果11.5 big Sur
  3. 本地数据库数据导入linux
  4. S7-300系列PLC如何通过GSD文件实现PROFIBUS DP主从通讯?
  5. 科学计算机怎么用10次方,一个数怎么用计算器开10次方
  6. 淘宝天猫融合能拉回“出淘”的用户吗?
  7. 【转】小谈PNG转SVG的方法 在线转换网站与illustrator
  8. Java类加载器深入探索
  9. windows共享文件设置虚拟服务器访问,怎么让虚拟机和宿主机之间互相访问共享文件夹...
  10. ubuntu 18.04虚拟机访问Windows磁盘或文件夹