ArcObjects Library Reference (Geometry)  

IEllipticArc.QueryCenterPoint Method

Copies the center of this arc to the input point.

[Visual Basic .NET]
Public Sub QueryCenterPoint ( _
    ByVal Center As IPoint _
)
[C#]
public void QueryCenterPoint (
    IPoint Center
);
[C++]
HRESULT QueryCenterPoint(
  IPoint* Center
);
[C++]

Parameters

Center

  Center is a parameter of type IPoint

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The CenterPoint is the point where the Major Axis and Minor Axis of the EllipticArc intersect.  The CenterPoint is the point from which all angles and distances are calculated to create the EllipticArc. You must instantiate the Point before calling QueryCenterPoint. For example,

Dim pPoint as IPoint
Set pPoint = New Point

Remarks

The QueryCenterPoint method should be used in performance critical situations, where the center point of several arcs needs to be retrieved. The point is populated (not created) by the method. For example, this can be used to get the center point of several arcs in a loop. Creating the point only once outside the loop may improve performance for large number of arcs.

EllipticArc QueryCenterPoint Example

[C#]

//This example demonstrates how to use the QueryCenterPoint method
private void QueryCenterPoint()
{
    IPoint center = new PointClass();
    center.PutCoords(10, 10);
    IEllipticArc ellipticArc = new EllipticArcClass();
    ellipticArc.PutCoordsByAngle(false, center, 0, Math.PI / 2, 0, 20, 0.4);
    //Cocreate the center point
    IPoint theCenterPoint = new PointClass();
    ellipticArc.QueryCenterPoint(theCenterPoint);
    System.Windows.Forms.MessageBox.Show("Center point coordinates \n" + theCenterPoint.X + ", " + theCenterPoint.Y);
}

[Visual Basic .NET]

    'This example demonstrates how to use the QueryCenterPoint method
    Sub QueryCenterPoint_example()
        Dim pEArc As IEllipticArc, dpi As Double
        Dim pCenter As IPoint, pTheCenterPoint As IPoint
        dpi = Math.Atan(1) * 4
        pCenter = New Point
        pEArc = New EllipticArc
        pCenter.PutCoords(10, 10)
        pEArc.PutCoordsByAngle(False, pCenter, 0, dpi / 2, 0, 20, 0.4)
        'Cocreate the center point
        pTheCenterPoint = New Point
        pEArc.queryCenterPoint(pTheCenterPoint)
        Debug.Print("Center point coordinates")
        Debug.Print(pTheCenterPoint.X & " , " & pTheCenterPoint.Y)
    End Sub

See Also

IEllipticArc Interface