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 ...
随机推荐
- ubuntu下的wps office for linux
今天修改老师给的论文,也没备份,悲剧的一幕发生了,原来用的word在ubuntu里打开,结果图片显示不出来,也不知怎么修复,哭死... 网上搜索答案,一位热心的网页推荐我用wps office for ...
- 博客网站-Hexo+GitHub+Netlify
Hexo+GitHub+Netlify一站式搭建属于自己的博客网站 https://www.cnblogs.com/kerbside/p/10130606.html https://hhongwen. ...
- 常用SQL语句积累
--批量设置表中某字段为固定值 update dbo.LampList set LampGroupAddress=ISNULL(LampGroupAddress,'')+1 --批量设置表中某字段为N ...
- 20165212实验三——敏捷开发与XP实践
20165212实验三 敏捷开发与XP实践 实验内容 XP基础 XP核心实践 相关工具 实验知识点总结 (一)敏捷开发与XP 软件工程:把系统的.有序的.可量化的方法应用到软件的开发.运营和维护上的过 ...
- 在C#中调用Java生成的jar包文件的方法
C#工程调用Java已生成的jar包步骤如下: 一.使用IKVM.NET组件 首先到IKVM官网(http://www.ikvm.net)下载组件,下载地址:https://sourceforge.n ...
- deno学习二 基本代码
deno 介绍是安全的ts 运行时 简单的代码 使用js(app.js) console.log("demoapp") 输出 dalongdemo 使用ts(app.ts) con ...
- 关于Eclipse中import javax.servlet.*出错
今天为了调试一下我写的Servlet,突然间,发现我的站点下所有的Servlet全部都出错了,仔细一看,原来是import javax.servlet.*这里出错了. 然后我就上网查阅了一些资料,才发 ...
- 去掉桌面SVN
1新建记事本 2for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn" 3重命名 删除S ...
- CodeForces - 983B XOR-pyramid(区间dp,异或)
XOR-pyramid time limit per test 2 seconds memory limit per test 512 megabytes input standard input o ...
- python调用R语言,关联规则可视化
首先当然要配置r语言环境变量什么的 D:\R-3.5.1\bin\x64; D:\R-3.5.1\bin\x64\R.dll;D:\R-3.5.1;D:\ProgramData\Anaconda3\L ...