我怎么能得到sqlgeometry弧的中心点?

时间:2013-08-03 01:08:52

标签: c# entity-framework geometry sqlgeometry

我有Mssql数据库我将一些几何存储在数据库中作为sqlgeometry 我在使用EF5的mvc4项目中工作,我在数据库中存储了弧线 我可以将其作为数据库获取,然后将其转换为sqlgeometry,因为某些原因我想得到这个弧的中心点? 是否有自由几何.net lib为我计算?

是我的示例代码,用于从弧上的3点构建弧形几何

            SqlGeometryBuilder geomBuil = new SqlGeometryBuilder();

        geomBuil.SetSrid(32637);
        geomBuil.BeginGeometry(OpenGisGeometryType.CircularString);
        geomBuil.BeginFigure(startPoint.X, startPoint.Y);
        geomBuil.AddCircularArc(PointOnArc.X, PointOnArc.Y, endPoint.X, endPoint.Y);
        geomBuil.EndFigure();
        geomBuil.EndGeometry();

        SqlGeometry arc = geomBuil.ConstructedGeometry;

1 个答案:

答案 0 :(得分:0)

圆圈有3个点 - startPoint,PointOnArc和endPoint。要查找圆心,您可以使用 Circumcircle equation section here中的公式。

相关问题