当前位置: 首页 > news >正文

国家建设部官方网站百度人工服务24小时

国家建设部官方网站,百度人工服务24小时,网站手机版,公司做网站的原因//取线段上两点之间的沿线线段//line 线//startDist:距离线第一个点的起点位置//stopDist:距离线第一个点的终点位置public static List<double[]> lineSliceAlong(List<double[]> line, double startDist, double stopDist){double travelled 0;double overshot …
  //取线段上两点之间的沿线线段//line 线//startDist:距离线第一个点的起点位置//stopDist:距离线第一个点的终点位置public static List<double[]> lineSliceAlong(List<double[]> line, double startDist, double stopDist){double travelled = 0;double overshot = 0;int origCoordsLength = line.Count;List<double[]> slice = new List<double[]>();//计算for (int i = 0; i < line.Count; i++){//如果起始距离大于,起始点位于的线段,且是最后一段儿则停止。if (startDist >= travelled && i == line.Count - 1) break;//如果 起始点位于的line分段段小于线段长度,且不是line的第一个点else if (travelled > startDist && slice.Count == 0){overshot = startDist - travelled;if (overshot == 0){slice.Add(line[i]);return slice;}//将点沿着向量方向移动距离Vector3 point1 = new Vector3((float)line[i][0], (float)line[i][1], (float)line[i][2]);Vector3 point2 = new Vector3((float)line[i - 1][0], (float)line[i - 1][1], (float)line[i - 1][2]);Vector3 direction = Vector3.Normalize(point1 - point2);Vector3 moveP = point1 + direction * (float)overshot;slice.Add(new double[] { moveP.X, moveP.Y, moveP.Z });slice.Add(new double[] { moveP.X, moveP.Y, moveP.Z });}if (travelled >= stopDist){overshot = stopDist - travelled;if (overshot == 0){slice.Add(line[i]);return slice;}Vector3 point1 = new Vector3((float)line[i][0], (float)line[i][1], (float)line[i][2]);Vector3 point2 = new Vector3((float)line[i - 1][0], (float)line[i - 1][1], (float)line[i - 1][2]);Vector3 direction = Vector3.Normalize(point1 - point2);Vector3 moveP = point1 + direction * (float)overshot;slice.Add(new double[] { moveP.X, moveP.Y, moveP.Z });return slice;}//线段起点if (travelled >= startDist){slice.Add(line[i]);}if (i == line.Count - 1){return slice;}List<double[]> tempLine = new List<double[]> { line[i], line[i + 1] };travelled += LineLength(tempLine);}if (travelled < startDist && line.Count == origCoordsLength){throw new Exception("Start position is beyond line");}double[] last = line[line.Count - 1];var temp = new List<double[]> { last, last };return temp;}//等距分割线public static List<double[]> lineChunck(List<double[]> line, double segmentLength, bool onlySegementPoint = false){List<double[]> result = new List<double[]>();double lineLength = LineLength(line);if (segmentLength <= 0){throw new Exception("segmentLength must be greater than 0");}//如果线比分段短,则返回原始数据if (lineLength <= segmentLength) return line;double numberOfSegments = lineLength / segmentLength;//如果分段不是整数则加1if ((int)numberOfSegments != numberOfSegments){numberOfSegments = Math.Floor(numberOfSegments) + 1;}for (int i = 0; i < numberOfSegments; i++){var outLine = lineSliceAlong(line, segmentLength * i, segmentLength * (i + 1));if (onlySegementPoint){result.Add(outLine.First());result.Add(outLine.Last());}else{for (int j = 0; j < outLine.Count; j++){var v = outLine[j];result.Add(v);}}}return distinctPoints(result);}//点去重public static List<double[]> distinctPoints(List<double[]> triplets){return triplets.Distinct(new TripletComparer()).ToList();}private class TripletComparer : IEqualityComparer<double[]>{public bool Equals(double[] x, double[] y){if (x.Length != y.Length) return false;for (int i = 0; i < x.Length; i++){if (x[i] != y[i]) return false;}return true;}public int GetHashCode(double[] obj){unchecked // Overflow is fine, just wrap{int hash = 17;foreach (var val in obj){hash = hash * 23 + val.GetHashCode();}return hash;}}}
http://www.ds6.com.cn/news/52365.html

相关文章:

  • wix做网站流程网店代运营公司
  • 怎么用ps做网站超链接百度广告推广费用一年多少钱
  • wordpress 点击文章图片路径谷歌seo网站推广怎么做
  • 这几年做网站怎么样鱼头seo软件
  • 网站开发中常见的注册界面广州seo网站排名
  • 分销网站建设注册公司网站
  • 设计wordpress主题下载地址seo外链发布平台有哪些
  • 网站的页面设计百度上怎么打广告宣传
  • 免费一级域名和空间百度关键词优化有效果吗
  • 做一个交易网站多少钱seo推广排名
  • 免费咨询法律问题的网站聚合搜索引擎入口
  • 男女做暖暖试看网站上海优化seo
  • 大连开发区规划建设局网站广告多的网站
  • 贸易网站建设案例seo实战指导
  • 微网站制作需要多少钱百度一下你就知道首页官网
  • 抚州网站制作百度免费发布信息
  • 网络推广网站培训班网站关键词快速优化
  • 买了网站 怎么做呢域名注册商怎么查
  • 本科学院网站建设方案手机网络优化软件
  • 晋中做网站软件推广赚钱一个10元
  • 那些企业网站做的漂亮网站推广与优化平台
  • 哪里网站建设联系网站制作论文
  • 响应式建站工具百度关键词seo排名软件
  • 如何把自己做的网站放到内网免费网站或软件
  • 毕业设计如何用dw做网站微营销平台
  • 白银市做网站网络兼职平台
  • 毕节做网站百度不收录网站
  • 立即关注公众号aso优化推广公司
  • 假网站连接怎么做的腾讯企业邮箱
  • php做网站导购关键词如何排名在首页