Showing posts with label between. Show all posts
Showing posts with label between. Show all posts

Thursday, October 15, 2009

Angle between 2 points in AutoCAD .Net

public static double AngleFromXY(Point3d pt1, Point3d pt2, Editor ed)

{

Matrix3d ucsmtx = ed.CurrentUserCoordinateSystem;

CoordinateSystem3d ucs = ucsmtx.CoordinateSystem3d;

Plane ucsplane = new Plane(ucs.Origin, ucs.Xaxis, ucs.Yaxis);

Vector3d vec = pt2 - pt1;

double ang = vec.AngleOnPlane(ucsplane);

return ang;

}