Here is a test code, it might help:
ads_point pt1, pt2, pt3, pt4;
acedGetPoint(NULL, "\nLine from: ", pt1);
acedGetPoint(pt1, "\nLine to: ", pt2);
acedGetPoint(NULL, "\nLine from: ", pt2);
acedGetPoint(pt2, "\nLine to: ", pt3);
AcGePoint3d ptA( pt1, pt1, pt1 );
AcGePoint3d ptB( pt2, pt2, pt2 );
AcGePoint3d ptC( pt3, pt3, pt3 );
AcGePoint3d ptD( pt4, pt4, pt4 );
AcGeLine3d line1(ptA,ptB) , line2(ptC,ptD);
AcGeVector3d v1 = line1.direction();
AcGeVector3d v2 = line2.direction();
if ( v1.angleTo(v2) != v2.angleTo(v1) ){
acutPrintf("\nSame direction");
}
else {
acutPrintf("\nNot the same direction");
}
--
http://www.geometricad.com
wrote in message news:5097904@discussion.autodesk.com...
What is the easiest way to tell if two lines are going in the same
direction.
Eg: P1 & P2
P1 startPoint = 0,0,0 end point = 1,0,0
P2 startPoint = -1,0,0 end point = 0,0,0
They are actually going away from each other. How can I tell using Vectors?
Any help?
Mike Bujak