Division of Line Segment
Division of Line Segment
/** */
void Line::EqualDivision(int nCount, QLineF fline, QList<QPointF> *ltPts)
{
Q_ASSERT(0 != ltPts);
QPointF p1,p2;
float x,y,xStep,yStep,nStepLen;
ltPts->clear();
if(nCount<=1){
return;
}
p1 = fline.p1();
p2 = fline.p2();
if(p1.x() == p2.x() && p1.y() == p2.y()){
return;
}
nStepLen = fline.length()/nCount;
for(int i=1; i<nCount; i++){
x = (i*nStepLen*p2.x() + (nCount-i)*nStepLen*p1.x())/fline.length();
y = (i*nStepLen*p2.y() + (nCount-i)*nStepLen*p1.y())/fline.length();
ltPts->append(QPointF(x,y));
}
}
Reference
Division of Line Segment的更多相关文章
- HowTo Perform the spatial selection 'Share a line segment with' using ArcObjects
HowTo Perform the spatial selection 'Share a line segment with' using ArcObjects Article ID: 26528 ...
- 目标检测之线段检测---lsd line segment detector
(1)线段检测应用背景 (2)线段检测原理简介 (3)线段检测实例 a line segment detector (4)hough 变换和 lsd 的区别 --------------------- ...
- HDU 1542/POJ 1151 Atlantis (scaning line + segment tree)
A template of discretization + scaning line + segment tree. It's easy to understand, but a little di ...
- Line segment matching
FMII2方法:FMII方法的轻微的修改.有限线段和无限线段(直线)的匹配. 求解方法: SVD分解 Unit Quaternion 协方差矩阵: 通过对C进行SVD分解得到R,根据R求得T. 算法流 ...
- Android OpenGL ES(九)绘制线段Line Segment .
创建一个DrawLine Activity,定义四个顶点: float vertexArray[] = { -0.8f, -0.4f * 1.732f, 0.0f, -0.4f, 0.4f * 1.7 ...
- Codeforces gym102058 J. Rising Sun-简单的计算几何+二分 (2018-2019 XIX Open Cup, Grand Prix of Korea (Division 2))
J. Rising Sun time limit per test 1.0 s memory limit per test 1024 MB input standard input output st ...
- opencv cv.line
''' 本次来学习基于opencv进行各种画图操作,以前只习惯用matplotlib,最近开始用opencv,觉得也很好用. cv.line(), cv.circle() , cv.rectangle ...
- CartO
Carto documentation The following is a list of properties provided in CartoCSS that you can apply to ...
- RFC-TCP
RFC: 793 TRANSMISSION CONTROL PROTOCOL DARPA INTERNET PROGRAM PROTOCOL SPECIFICATION September 1981 ...
随机推荐
- Winform开发常用控件之DataGridView的简单数据绑定——自动绑定
DataGridView控件可谓是Winform开发的重点控件,对于数据的呈现和操作非常方便,DataGridView可谓是既简单又复杂.简单在于其已经集成了很多方法,复杂在于可以使用其实现复杂的数据 ...
- cool 软件 —— Carnac(实时桌面显示按键)
1. Carnac 下载地址:Carnac, the Magnificent Keyboard Utility 使用说明:carnac – 在屏幕实时显示按键操作
- office 2013 图标编辑
1,找图标,网站:https://www.iconfinder.com/ 2,找到图标后用qq截图,之后粘贴到Adobe Illustrator 里边. 3,选定图像后,点击对象->图像描摹-& ...
- 服务器大量TIME_WAIT和CLOSE_WAIT的原因及解决办法
Linux服务器下查看网络连接的状态 netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 它会显示例如下面的信息: ...
- 用Navicat复制数据库到本地(导入.sql文件运行)
今天装数据库的机子没开,项目运行不了,于是还是决定在自己电脑上装数据库,由于新学数据库操作,记录一下 一.转储sql文件 右键点击数据库,转储sql文件,点击结构和数据 存放在本地,开始转储 转储完成 ...
- 使用caddy 进行nodejs web应用近实时编译更新
caddy 相比nginx 是一个不错的轻量代理服务器,支持的功能也是比较多的, 同时插件也挺多 demo 测试的是通过git 插件进行一个使用spec-md 编写的文档近实时编译以及预览 项目使用d ...
- ballerina 学习十九 安全编程
ballerina 内部提供了几种常用的安全开发模型,token 认证(jwt) basic auth jwt 安全 参考代码 import ballerina/http; http:AuthPr ...
- C# zedgraph 怎么设置初始时坐标轴的比例??
http://bbs.csdn.net/topics/390872329 已解决,,,我问是刷新图用的,,我以为mypane.YAxis.Scale.Min=0; mypane.YAxis.Scale ...
- maven库 mvn依赖
http://maven.outofmemory.cn/ http://mvnrepository.com/ 先执行 mvn clean 然后执行 mvn 命令 如:mvn compile . ...
- Linux 解压zip need PK compat. v4.5 (can do v2.1)
p7z 当使用7zip压缩大于4G的文件后,在linux下解压时,出现下面的提示,无法解压: [root@localhost root]# unzip Wrestlemania20.zip Archi ...