## DG Kernel Documentation

 Home Page > API Reference > General Geometry > Curves > ILine_DG Search Documentation

# ILine_DG Interface

Init
Init1
Init2
GetOrigin
SetOrigin
GetDirection
SetDirection
DirectTowards
GetPoint
ReverseDirection
GetDistance
GetDistanceLine
GetLineIntersection
GetAngle
GetPointLocation
GetPointPosition
IsCollinear
IsCoplanar
GetLineLocation
Rotate
Copy
Clone

Represents a 3D ray (axis) defined by its origin and direction.

void Init(Point_DG origin, Vect_DG direction)

void Init1(Point_DG end0, Point_DG end1)

void Init2(Line_DG line)

Point_DG GetOrigin()

void SetOrigin(Point_DG origin)

Vect_DG GetDirection()

void SetDirection(Vect_DG direction)

void DirectTowards(Point_DG target, bool success)

Point_DG GetPoint(double u)

void ReverseDirection()

double GetDistance(Point_DG point, out Point_DG pointNearestOnThis, out double paramOnThis)

Computes distance point to this line.

pointNearestOnThis - [out] Parameter along this of the nearest point (distance origin to the point).

double GetDistanceLine(ILine_DG line, out double paramNearestThis, out double paramNearestLine)

Computes distance between two 3D lines.

paramNearestThis - [out] Parameter along this of the nearest point on this (distance origin to the point). Random if lines are collinear

paramNearestLine - [out] Parameter along line of the nearest point on line (distance origin to the point). Random if lines are collinear

bool GetLineIntersection(ILine_DG* line, double tolerance, out double* paramThis, out double* paramLine, out Point_DG* intersection)

Returns false if there is no single intersection point

paramThis - [out] Parameter of the intersection point on this (distance origin to the point).

paramLine - [out] Parameter of the intersection point on line.

double GetAngle(ILine_DG line)

Returns angle between the two lines in radians.

int GetPointLocation(Point_DG point, double tolerance)

Returns: 0 - at origin, 1 - on line before, 2 - on line after, 3 - not on line.

double GetPointPosition(Point_DG point)

Returns parameter of the point along the line, which is equal to distance to origin. Uses projection to the line if the point is outside.

bool IsCollinear(ILine_DG iLine, double tolerance)

bool IsCoplanar(ILine_DG line, double tolerance)

int GetLineLocation(ILine_DG line, double tolerance)

Returns: 0 - unknown (error), 1 - identical, 2 - the lines coinside geometrically, but origins are different, 3 - intersection, 4 - parallel, 5 - general position.

void Rotate(ILine_DG axis, double angleBy)