Interface IPoint
Provides access to members that define two dimensional points.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("1B077915-38C5-11D0-92D2-00805F7C28B0")]
public interface IPoint : IGeometry
Remarks

Properties
Dimension
esriGeometryDimension Dimension { get; }
Property Value
Envelope
IEnvelope Envelope { get; }
Property Value
GeometryType
esriGeometryType GeometryType { get; }
Property Value
ID
The Point ID attribute.
int ID { get; set; }
Property Value
Remarks
The following C# code explains how to do it:
IPoint pnt = new PointClass();
pnt.PutCoords(100, 100);
IPointIDAware pntIDA = pnt as IPointIDAware;
pntIDA.PointIDAware = true;
pnt.ID = 10;
IsEmpty
bool IsEmpty { get; }
Property Value
M
The measure attribute.
double M { get; set; }
Property Value
Remarks
// The following example shows how to set the x,y,z,m properties
// for a point. Note that you need to tell the point to be
// M- and Z-aware.
public void DisplayCoordinates()
{
IPoint point = new PointClass();
point.PutCoords(100, 100);
IMAware mAware = point as IMAware;
mAware.MAware = true;
IZAware zAware = point as IZAware;
zAware.ZAware = true;
point.Z = 50;
point.M = 10;
System.Windows.Forms.MessageBox.Show(point.X + "," + point.Y + "," + point.Z + "," + point.M);
}
SpatialReference
ISpatialReference SpatialReference { get; set; }
Property Value
VertexAttribute[esriGeometryAttributes]
Any attribute (coordinate), except X or Y.
double VertexAttribute[esriGeometryAttributes attributeType] { get; set; }
Parameters
attributeTypeesriGeometryAttributes
Property Value
X
The X coordinate.
double X { get; set; }
Property Value
Y
The Y coordinate.
double Y { get; set; }
Property Value
Remarks

// The following example shows how to set the x,y,z,m properties
// for a point. Note that you need to tell the point to be
// M- and Z-aware.
public void DisplayCoordinates()
{
IPoint point = new PointClass();
point.PutCoords(100, 100);
IMAware mAware = point as IMAware;
mAware.MAware = true;
IZAware zAware = point as IZAware;
zAware.ZAware = true;
point.Z = 50;
point.M = 10;
System.Windows.Forms.MessageBox.Show(point.X + "," + point.Y + "," + point.Z + "," + point.M);
}
Z
The Z attribute.
double Z { get; set; }
Property Value
Methods
Compare(IPoint)
Compares X, Y, M, Z, ID of this point (in that order) with that of the other point. Returns -1 if this point's value is less, 1 if greater, and 0 otherwise. Useful for sorting a group of points.
int Compare(IPoint otherPoint)
Parameters
otherPointIPoint
Returns
Remarks
The method should not be used in order to determine equality of two points. Use IRelationalOperator::Equals or IClone::IsEqual. At 9.2, this method uses the resolution property of the point's spatial reference in order to determine (x,y) coordinate ordering. At 9.1, an untoleranced (exact) comparison was performed.
ConstrainAngle(double, IPoint, bool)
Projects this point to the point on the infinite line defined by anchor and angle (in radians). If allowOpposite is true, then the point can also snap to angle + pi radians.
void ConstrainAngle(double constraintAngle, IPoint anchor, bool allowOpposite)
Parameters
Remarks
ContrainAngle

//Finds the closes point to line from (0,0) with angles
//defined by steps of pi/4 (Note all angles in radians)
private void ConstrainAngle()
{
IPoint point = new PointClass();
point.PutCoords(0, 0);
IPoint newPoint = new PointClass();
newPoint.PutCoords(1,0);
for (int i = 0; i < 8; i++)
{
newPoint.ConstrainAngle(i * Math.PI / 4, point,
true);
System.Windows.Forms.MessageBox.Show(newPoint.X + ", " +
newPoint.Y);
}
}
'Finds the closes point to line from (0,0)
with angles
'defined by steps of pi/4 (Note all angles in
radians)
'
Sub TestConstrainAngle()
Dim pApoint As
ESRI.ArcGIS.Geometry.IPoint
Dim pNpoint As
ESRI.ArcGIS.Geometry.IPoint
Dim pi As Double
Dim dAngle As Double
Dim i As Long
pApoint = New
ESRI.ArcGIS.Geometry.Point
pi = 4 *
Math.Atan(1)
dAngle = 0
pApoint.PutCoords(0,
0)
pNpoint = New ESRI.ArcGIS.Geometry.Point
For i = 0 To 7
pNpoint.PutCoords(1, 0)
dAngle = i * pi / 4
pNpoint.ConstrainAngle(dAngle, pApoint, True)
MsgBox("angle = " & i & "*pi/4" & vbCrLf &
pNpoint.X & "," & pNpoint.Y)
Next i
End Sub
ConstrainDistance(double, IPoint)
Projects this point to the perimeter of the circle defined by radius and anchor.
void ConstrainDistance(double constraintRadius, IPoint anchor)
Parameters
Remarks
ConstrainDistance

private void ConstrainDistance()
{
IPoint point = new PointClass();
point.PutCoords(0, 0);
IPoint newPoint = new PointClass();
newPoint.PutCoords(2,2);
newPoint.ConstrainDistance(Math.PI, point);
System.Windows.Forms.MessageBox.Show(newPoint.X + ", " + newPoint.Y);}
Public Sub ConstrainDistanceTest()
Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
Dim pNPoint As ESRI.ArcGIS.Geometry.IPoint
Dim dRadius As Double
pPoint = New ESRI.ArcGIS.Geometry.Point
pPoint.PutCoords(0, 0)
pNPoint = New ESRI.ArcGIS.Geometry.Point
pNPoint.PutCoords(2, 2)
dRadius = 1.4142135623731
pNPoint.ConstrainDistance(dRadius, pPoint)
MsgBox("Radius = " & dRadius & " x,y = " & pNPoint.X & "," & pNPoint.Y)
End Sub
GeoNormalize()
void GeoNormalize()
GeoNormalizeFromLongitude(double)
void GeoNormalizeFromLongitude(double Longitude)
Parameters
Longitudedouble
Project(ISpatialReference)
void Project(ISpatialReference newReferenceSystem)
Parameters
newReferenceSystemISpatialReference
PutCoords(double, double)
Sets the X and Y coordinates.
void PutCoords(double X, double Y)
Parameters
Remarks
{
IPoint point = new PointClass();
point.PutCoords(0, 0);
System.Windows.Forms.MessageBox.Show(point.X + ", " + point.Y);
}
QueryCoords(out double, out double)
Returns the X and Y coordinates.
void QueryCoords(out double X, out double Y)
Parameters
QueryEnvelope(IEnvelope)
void QueryEnvelope(IEnvelope outEnvelope)
Parameters
outEnvelopeIEnvelope
SetEmpty()
void SetEmpty()
SnapToSpatialReference()
void SnapToSpatialReference()