Hi!
I have two lines to compare direction.( to check two line go same direction or not.)
I made two Ray3D objects from the lines like below.
Dim oRay_Cell As Ray3dDim oRay_Line As Ray3d
oRay_Cell = Ray3dFromPoint3dStartEnd(oLineFromCell.startPoint, oLineFromCell.EndPoint)oRay_Line = Ray3dFromPoint3dStartEnd(oLineFromLine.startPoint, oLineFromLine.EndPoint)
But I don't know how to compare the direction.
oRay_Cell.Direction ,,,,, oRay_Line.Direction
Hi,
One issue I had (using a different command) was tolerance. I had to say, if the difference in angle is less than my tolerance, then it is parallel. With out that, I had "rounding errors" which produced an insignificant difference that would tell me that the lines were not parallel.
--Robert
Unknown said:One issue I had (using a different command) was tolerance. I had to say, if the difference in angle is less than my tolerance, then it is parallel
That's an argument in favour of using the cross-product of two vectors. First, it's simpler than extracting and comparing three sets of angles; second, it's numerically concise: if the cross-product is zero then the vectors are parallel.
The cross-product can also inform you if two unit vectors are perpendicular. You can see why the cross-product, and its companion the dot-product, are useful and why they are included in the VBA library. See...
Regards, Jon Summers LA Solutions