public bool isArc(expectedType ExpectType) { return (ExpectType == ptsCogo.Horizontal.expectedType.ArcSegmentInsideSolution || ExpectType == ptsCogo.Horizontal.expectedType.ArcSegmentOutsideSoluion || ExpectType == ptsCogo.Horizontal.expectedType.ArcHalfCircle); }
public rm21HorArc(ptsPoint begPt, ptsPoint centerPt, ptsPoint endPt, expectedType ExpectedType, int deflectionDirection) : base(begPt, endPt) { this.deflDirection = deflectionDirection; this.ArcCenterPt = centerPt; this.BeginRadiusVector = this.ArcCenterPt - this.BeginPoint; this.EndRadiusVector = this.ArcCenterPt - this.EndPoint; this.Radius = this.BeginRadiusVector.Length; Double validationRadius = this.EndRadiusVector.Length; if (Math.Abs(this.Radius - validationRadius) > 0.00014) throw new Exception("Given points do not represent a circle."); Double degreesToAdd = 90 * deflectionDirection; if (ExpectedType == expectedType.ArcSegmentOutsideSoluion) deflectionDirection *= -1; this.BeginAzimuth = this.BeginRadiusVector.Azimuth + ptsAngle.radiansFromDegree(degreesToAdd); this.EndAzimuth = this.EndRadiusVector.Azimuth + ptsAngle.radiansFromDegree(degreesToAdd); // applies to English projects only (for now) this.BeginDegreeOfCurve = HorizontalAlignmentBase.computeDegreeOfCurve(this.Radius); this.EndDegreeOfCurve = this.BeginDegreeOfCurve; if (ExpectedType == expectedType.ArcSegmentOutsideSoluion) { computeDeflectionForOutsideSolutionCurve(); this.Length = 100.0 * this.Deflection.getAsRadians() / this.BeginDegreeOfCurve.getAsRadians(); this.Length = Math.Abs(this.Length); } else { Deflection = new Deflection(this.BeginAzimuth, this.EndAzimuth, true); Double deflAsRadians = this.Deflection.getAsRadians(); Double DcAsRadians = this.BeginDegreeOfCurve.getAsRadians(); this.Length = 100.0 * deflAsRadians / DcAsRadians; this.Length = 100.0 * this.Deflection.getAsRadians() / this.BeginDegreeOfCurve.getAsRadians(); this.Length = Math.Abs(this.Length); } }