LineSegment line = LineBuilder.CreateLineSegment(new Coordinate2D(0, 0), new Coordinate2D(1, 0));
// No extension, distanceAlongCurve = 0.5
LineSegment tangent = GeometryEngine.Instance.QueryTangent(line, SegmentExtension.NoExtension, 0.5, AsRatioOrLength.AsRatio, 1);
// tangent.StartCoordinate = (0.5, 0.0)
// tangent.EndCoordinate = (1.5, 0.0)
tangent = GeometryEngine.Instance.QueryTangent(line, SegmentExtension.NoExtension, 1.5, AsRatioOrLength.AsLength, 1);
// tangent.StartCoordinate = (1.0, 0.0)
// tangent.EndCoordinate = (2.0, 0.0)
tangent = GeometryEngine.Instance.QueryTangent(line, SegmentExtension.ExtendTangentAtTo, 1.5, AsRatioOrLength.AsLength, 1);
// tangent.StartCoordinate = (1.5, 0.0)
// tangent.EndCoordinate = (2.5, 0.0)
tangent = GeometryEngine.Instance.QueryTangent(line, SegmentExtension.ExtendTangentAtFrom, -1.5, AsRatioOrLength.AsLength, 1);
// tangent.StartCoordinate = (-1.5, 0.0)
// tangent.EndCoordinate = (-0.5, 0.0)
tangent = GeometryEngine.Instance.QueryTangent(line, SegmentExtension.ExtendTangentAtFrom, -0.5, AsRatioOrLength.AsRatio, 1);
// tangent.StartCoordinate = (-0.5, 0.0)
// tangent.EndCoordinate = (0.5, 0.0)