# How to create a circle with ArcEngine?

I want to create a circle with IPoint P and radius r in ArcEngine and then I need to cast it to an IGeometry. Does anyone know how to do this?

ESRI ArcEngine 10 VS2010 C#

found it

``````ISegmentCollection p = new PolygonClass();
p.SetCircle(mousepoint, 20);
IGeometry circleGeo = p as IGeometry;
``````
• Kudos for this. You are correct, and I don't think a lot of people know about the SegmentCollection and the various Set methods that get used along with it. This answer adds greatly useful information to the gis.stackexchange pool. Commented Jan 17, 2011 at 22:26
• @celticflute sorry to report that it doesn't work properly after some testing Commented Jan 17, 2011 at 22:34
• I'm curious - what kind of test did it fail? Commented Jan 18, 2011 at 2:47
• @Kirk Kuykendall it created the circle in the wrong place Commented Jan 18, 2011 at 14:47
• @Kirk, iterationx: I just tested this and seems to work perfectly for me... Commented Jan 19, 2011 at 17:39

EllipticArcClass ellipticalArc = new EllipticArcClass();

IEnvelope env = new EnvelopeClass();

IPoint lowerLeft = new PointClass();

lowerLeft.X = centerPoint.X - width;

lowerLeft.Y = centerPoint.Y - height;

IPoint upperRight = new PointClass();

upperRight.X = centerPoint.X + width;

upperRight.Y = centerPoint.Y + height;

env.LowerLeft = lowerLeft;

env.UpperRight = upperRight;

ellipticalArc.ConstructEnvelope(env);

IGraphicTrackerSymbol graphicTrackerSymbol = this.graphicTracker.CreateSymbol(simpleFillSymbol, null);

Another method is to cast your point to ITopologicalOperator and use the Buffer method to buffer the point by the radius.

• I think this method works for Projected coordinate systems, but will give strange results if you are working with a Geographic coordinate system. Commented Jan 31, 2011 at 4:07

I prefer the `ISegmentCollection` solution myself, but you can also recast your `IPoint` or `IGeometry` as `ITopologicalOperator` and call the `Buffer` method.

• -1 for basically taking two of the answers, restating the same, and adding no value. Commented Jan 29, 2011 at 10:32