如何绘制SQL Server“ circularstring”在C#中 [英] How to draw SQL Server "circularstring" in C#

查看:148
本文介绍了如何绘制SQL Server“ circularstring”在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL Server具有空间类型 circularstring,它是奇数点的集合。如何在C#中绘制此类型。 Drawarc基于角度工作,而在圆弦中我们只有一点。 Drawcurve基于这些点工作,但结果与圆弧字符串不同。有了三个点,圆弧线就是圆弧的圆弧,而没有弯道。



非常感谢。



Majid

解决方案

基本解决方案如下:




  • 取三个点A,B,C(蓝色)并创建弧。

  • 取最后一个加上下两个,并创建下一个弧。

  • 继续,直到使用了所有点。

  • 如果点数为偶数或两个连续点相同,则数据无效。



弧:




  • 找到圆的中心M(绿色)(黄线的交点)

  • 查找x轴与M和A之间的连接(起始角度,橙色)之间的(顺时针)角度

  • 查找M和A与C之间的角度(后掠角度) ,橙色)



现在您可以



黄色短线连接点;长的人垂直站立在他们身上。


SQL Server has a spatial type "circularstring" that is collection of odd points. How can I draw this type in c#. Drawarc works based on angles while in circularstring we have just points. Drawcurve works based on the points but the result is not the same as circularstring. With three points, circularstring is an arc of the circle pass through that points while curve is not.

Thanks a lot.

Majid

解决方案

The basic solution could look like this:

  • Take three points A,B,C (blue) and create the arc.
  • Take the last one plus the next two and create the next arc.
  • Continue until all points are used.
  • If the number of points is even or if two consecutive points are the same the data are invalid.

To create the arc:

  • Find the center M (green) of the circle (the crossing of the yellow lines)
  • Find the (clockwise) angle between the x-axis and the connection between M and A (starting angle, orange)
  • Find the angle between M and A and C (sweep angle, orange)

Now you can draw the arc.

The short yellow lines connect the points; the long ones stand perpendicular on them.

这篇关于如何绘制SQL Server“ circularstring”在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆