public clsLine Normal() { clsLine functionReturnValue = default(clsLine); //Special routine to help with finding "signed" distance of points to lines double theta = 0; theta = Angle; functionReturnValue = new clsLine(0, 0, 0, 1); functionReturnValue.Rotate(Angle); return(functionReturnValue); }
public clsPoint Intersect(clsCircle c1, bool firstSolution) { double a = 0; clsLine l1 = default(clsLine); if (mdlGeometry.Dist(Centre, c1.Centre) > Radius + c1.Radius) { return(null); } if (mdlGeometry.Dist(Centre, c1.Centre) < Abs(Radius - c1.Radius)) { return(null); } l1 = new clsLine(Centre.Copy(), c1.Centre.Copy()); a = Acos((Radius * Radius + l1.Length * l1.Length - c1.Radius * c1.Radius) / (2 * Radius * l1.Length)); //Cosine rule if (firstSolution == false) { a = -a; } l1.Rotate(a); l1.Length = Radius; return(l1.P2); }