Interface ILine
Provides access to members that identify a straight line segment and defines its properties.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("FEA4C71C-C5AE-11D0-8307-0000F8034032")]
public interface ILine : ICurve, IGeometry
Remarks
The PutCoords method requires 2 Point objects to construct
the line segment.

// This example creates a simple line and gets
the angle
// and the start and endpoint.
public void ShowLineAngle()
{
IPoint fromPoint = new
PointClass();
fromPoint.PutCoords(100,
100);
IPoint toPoint = new
PointClass();
toPoint.PutCoords(150,
150);
ILine line = new
LineClass(); line.PutCoords(fromPoint, toPoint);
double angle =
line.Angle;
//query Coordinats line.QueryCoords(outFromPoint, outToPoint);
IPoint outFromPoint =
new PointClass();
IPoint outToPoint = new
PointClass();
System.Windows.Forms.MessageBox.Show("From X = " + outFromPoint.X
+ ", From Y = " + outFromPoint.Y + "\n" + "To X = " + outToPoint.X + ", To Y = " + outToPoint.Y + "\n" + "Angle = " + angle);
}
Properties
Angle
The angle between this line and the positive x-axis.
double Angle { get; }
Property Value
Remarks
The following Visual Basic example gets the angle of a line and converts it to degrees :
dAngleDegree = (180 * pLine.Angle) / Pi
Where Pi = 4 * Atn(1)
Dimension
esriGeometryDimension Dimension { get; }
Property Value
Envelope
IEnvelope Envelope { get; }
Property Value
FromPoint
IPoint FromPoint { get; set; }
Property Value
GeometryType
esriGeometryType GeometryType { get; }
Property Value
IsClosed
bool IsClosed { get; }
Property Value
IsEmpty
bool IsEmpty { get; }
Property Value
Length
double Length { get; }
Property Value
SpatialReference
ISpatialReference SpatialReference { get; set; }
Property Value
ToPoint
IPoint ToPoint { get; set; }
Property Value
Methods
GeoNormalize()
void GeoNormalize()
GeoNormalizeFromLongitude(double)
void GeoNormalizeFromLongitude(double Longitude)
Parameters
Longitudedouble
GetSubcurve(double, double, bool, out ICurve)
void GetSubcurve(double fromDistance, double toDistance, bool asRatio, out ICurve outSubcurve)
Parameters
Project(ISpatialReference)
void Project(ISpatialReference newReferenceSystem)
Parameters
newReferenceSystemISpatialReference
PutCoords(IPoint, IPoint)
Sets this line's endpoints to be 'from' and 'to'.
void PutCoords(IPoint from, IPoint to)
Parameters
Remarks

QueryCoords(IPoint, IPoint)
Copies the endpoints of this line to 'from' and 'to'.
void QueryCoords(IPoint from, IPoint to)
Parameters
Remarks

QueryEnvelope(IEnvelope)
void QueryEnvelope(IEnvelope outEnvelope)
Parameters
outEnvelopeIEnvelope
QueryFromPoint(IPoint)
void QueryFromPoint(IPoint from)
Parameters
fromIPoint
QueryNormal(esriSegmentExtension, double, bool, double, ILine)
void QueryNormal(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, double Length, ILine normal)
Parameters
extensionesriSegmentExtensionDistanceAlongCurvedoubleasRatioboolLengthdoublenormalILine
QueryPoint(esriSegmentExtension, double, bool, IPoint)
void QueryPoint(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, IPoint outPoint)
Parameters
extensionesriSegmentExtensionDistanceAlongCurvedoubleasRatiobooloutPointIPoint
QueryPointAndDistance(esriSegmentExtension, IPoint, bool, IPoint, ref double, ref double, ref bool)
void QueryPointAndDistance(esriSegmentExtension extension, IPoint inPoint, bool asRatio, IPoint outPoint, ref double DistanceAlongCurve, ref double distanceFromCurve, ref bool bRightSide)
Parameters
extensionesriSegmentExtensioninPointIPointasRatiobooloutPointIPointDistanceAlongCurvedoubledistanceFromCurvedoublebRightSidebool
QueryTangent(esriSegmentExtension, double, bool, double, ILine)
void QueryTangent(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, double Length, ILine tangent)
Parameters
extensionesriSegmentExtensionDistanceAlongCurvedoubleasRatioboolLengthdoubletangentILine
QueryToPoint(IPoint)
void QueryToPoint(IPoint to)
Parameters
toIPoint
ReverseOrientation()
void ReverseOrientation()
SetEmpty()
void SetEmpty()
SnapToSpatialReference()
void SnapToSpatialReference()