public void Deflection_negativeLessThan180_getAsDegrees() { Double expectedValue = -45.0; Deflection defl = new Deflection(0.785398164, -1); Double actualValue = defl.getAsDegreesDouble(); Assert.AreEqual(expected: expectedValue, actual: actualValue, delta: 0.00001); }
public void Deflection_negativeGreaterThan180_getAsDegrees() { Double expectedValue = -310.0; Deflection defl = new Deflection(5.41052068118, -1); Double actualValue = defl.getAsDegreesDouble(); Assert.AreEqual(expected: expectedValue, actual: actualValue, delta: 0.00001); }
public override List<StationOffsetElevation> getStationOffsetElevation(ptsPoint interestPoint) { ptsVector BeginToInterestPtVector = new ptsVector(this.BeginPoint, interestPoint); Deflection BeginToInterestDeflection = new Deflection(this.BeginAzimuth, BeginToInterestPtVector.Azimuth, true); if (Math.Abs(BeginToInterestDeflection.getAsDegreesDouble()) > 90.0) return null; ptsVector EndToInterestPtVector = new ptsVector(this.EndPoint, interestPoint); Deflection EndToInterestDeflection = new Deflection(this.EndAzimuth, EndToInterestPtVector.Azimuth, true); if (Math.Abs(EndToInterestDeflection.getAsDegreesDouble()) < 90.0) return null; Double length = BeginToInterestPtVector.Length * Math.Cos(BeginToInterestDeflection.getAsRadians()); Double theStation = this.BeginStation + length; Double offset = BeginToInterestPtVector.Length * Math.Sin(BeginToInterestDeflection.getAsRadians()); var soe = new StationOffsetElevation(this.BeginStation + length, offset, 0.0); var returnList = new List<StationOffsetElevation>(); returnList.Add(soe); return returnList; }
public void Deflection_setTo_Pos2_shouldBe_Pos2Degrees() { Deflection defl = new Deflection(); defl.setFromDegreesDouble(2.0); Double expected = 2.0; Double actual = defl.getAsDegreesDouble(); Assert.AreEqual(expected: expected, actual: actual, delta: delta); }
public void Deflection_setTo_neg5__18__29_5() { Deflection aDeflection = new Deflection(); aDeflection.setFromDegreesMinutesSeconds(-5, 18, 29.5); Double expected = -5.308194444444; Double actual = aDeflection.getAsDegreesDouble(); Assert.AreEqual(expected: expected, actual: actual, delta: delta); }
public override List<StationOffsetElevation> getStationOffsetElevation(ptsPoint interestPoint) { ptsVector arcCenterToInterestPtVector = new ptsVector(this.ArcCenterPt, interestPoint); Deflection deflToInterestPt = new Deflection(this.BeginRadiusVector.Azimuth, arcCenterToInterestPtVector.Azimuth, true); int arcDeflDirection = Math.Sign(this.Deflection.getAsDegreesDouble()); if (arcDeflDirection * deflToInterestPt.getAsDegreesDouble() < 0.0) { return null; } else if (Math.Abs(this.Deflection.getAsDegreesDouble()) - Math.Abs(deflToInterestPt.getAsDegreesDouble()) < 0.0) { return null; } Double interestLength = this.Length * deflToInterestPt.getAsRadians() / this.Deflection.getAsRadians(); Offset offset = new Offset(arcDeflDirection * (this.Radius - arcCenterToInterestPtVector.Length)); var soe = new StationOffsetElevation(this.BeginStation + interestLength, offset, 0.0); var returnList = new List<StationOffsetElevation>(); returnList.Add(soe); return returnList; }