public Profile getSectionProfile(ptsPoint BeginPoint, double startStation, ptsPoint EndPoint) { if (null == theProfile) { theProfile = new Profile(startStation, Math.Abs(startStation), 10.0); } return theProfile; }
public void expandByPoint(Double x, Double y, Double z) { if (lowerLeftPt.isEmpty == true) { lowerLeftPt = new ptsPoint(x, y, z); upperRightPt = new ptsPoint(x, y, z); } else { if (x < lowerLeftPt.x) lowerLeftPt.x = x; if (y < lowerLeftPt.y) lowerLeftPt.y = y; if (z < lowerLeftPt.z) lowerLeftPt.z = z; if (x > upperRightPt.x) upperRightPt.x = x; if (y > upperRightPt.y) upperRightPt.y = y; if (z > upperRightPt.z) upperRightPt.z = z; } }
public bool isPointInsideBB2d(ptsPoint testPoint) { if (testPoint.x < lowerLeftPt.x) return false; if (testPoint.y < lowerLeftPt.y) return false; if (testPoint.x > upperRightPt.x) return false; if (testPoint.y > upperRightPt.y) return false; return true; }
//[Test] public void TIN_GardenParkwayTests_PointOnTriangleVertexHasCorrectElevation() { if (null == GardenParkwayDTM) Assert.True(true); var testpoint = new ptsPoint(529649.9585, 1406460.9585); var expectedElevation = 683.7885; var actualElevation = GardenParkwayDTM.getElevation(testpoint); timerStopAndPrint(); Assert.AreEqual( expected: expectedElevation, actual: actualElevation, delta: 0.0001, message: "Elevation"); }
public ptsPoint plus(ptsPoint aPoint) { if (aPoint.isEmpty) { return new ptsPoint(); } return new ptsPoint(aPoint.x + this.x, aPoint.y + this.y, aPoint.z + this.z); }
public ptsPoint(ptsPoint otherPt) { isEmpty_ = false; x = otherPt.x; y = otherPt.y; z = otherPt.z; }
public int compareByYthenX(ptsPoint other) { int xComp; int yComp; yComp = this.y_.CompareTo(other.y_); if (yComp == 0) { xComp = this.x_.CompareTo(other.x_); return xComp; } return yComp; }
public ptsBoundingBox2d(ptsPoint aPoint) { lowerLeftPt = new ptsPoint(aPoint); upperRightPt = new ptsPoint(aPoint); }
public void TIN_GardenParkwayTests_PointOnTriangleHasCorrectValues() { if (null == GardenParkwayDTM) Assert.True(true); var testpoint = new ptsPoint(529790.0, 1406750.0); var expectedElevation = 674.9297; var actualElevation = GardenParkwayDTM.getElevation(testpoint); timerStopAndPrint(); Assert.AreEqual( expected: expectedElevation, actual: actualElevation, delta: 0.0001, message: "Elevation"); var expectedSlope = 7.072; var actualSlope = GardenParkwayDTM.getSlope(testpoint); timerStopAndPrint(); Assert.AreEqual( expected: expectedSlope, actual: actualSlope, delta: 0.01, message: "Slope"); var expectedAzimuth = 176.905; var actualAzimuth = GardenParkwayDTM.getSlopeAzimuth(testpoint); timerStopAndPrint(); Assert.AreEqual( expected: expectedAzimuth, actual: actualAzimuth.getAsDegreesDouble(), delta: 0.0001, message: "Azimuth of Slope"); }
public void TIN_whenXYpointIsOnTheTINhull_ElevationIsCorrect() { double expectedDbl, actualDbl; expectedDbl = 454.504; ptsPoint testPt = new ptsPoint(2082985.4480, 740657.1722, 0.0); actualDbl = (Double)aDTM.getElevation(testPt); timerStopAndPrint(); Assert.AreEqual(expected: expectedDbl, actual: actualDbl, delta: 0.0015); }
public void TIN_whenXYpointIsOnInternalTriangleVertex_ElevationIsCorrect() { double expectedDbl, actualDbl; expectedDbl = 482.5578; ptsPoint testPt = new ptsPoint(2082886.0883, 740821.373, 0.0); actualDbl = (Double)aDTM.getElevation(testPt); timerStopAndPrint(); Assert.AreEqual(expected: expectedDbl, actual: actualDbl, delta: 0.0015); }
public void TIN_whenXYpointIsOnInternalTriangleLine_ElevationIsCorrect() { double expectedDbl, actualDbl; expectedDbl = 464.0131; ptsPoint testPt = new ptsPoint(2083058.8956, 740819.1854, 0.0); actualDbl = (Double)aDTM.getElevation(testPt); timerStopAndPrint(); Assert.AreEqual(expected: expectedDbl, actual: actualDbl, delta: 0.0015); }
public void TIN_whenPointIsOutsideBoundingBox_shouldReturnNull() { double? elev; ptsPoint testPt = new ptsPoint(2082100.0, 74200.0, 0.0); elev = aDTM.getElevation(testPt); timerStopAndPrint(); Assert.IsNull(elev); }
public void TIN_whenPointIsInsideBoundingBoxAndOutsideTinHull_shouldReturnNull() { double? elev; ptsPoint testPt = new ptsPoint(2083000, 740648.0, 0.0); elev = aDTM.getElevation(testPt); timerStopAndPrint(); Assert.IsNull(elev); }
public bool isPointInsideBB3d(ptsPoint testPoint) { if (isPointInsideBB2d(testPoint) == false) return false; if (testPoint.z < lowerLeftPt.z) return false; if (testPoint.z > upperRightPt.z) return false; return true; }
public ptsBoundingBox2d(Double LLx, Double LLy, Double LLz, Double URx, Double URy, Double URz) { lowerLeftPt = new ptsPoint(LLx, LLy, LLz); upperRightPt = new ptsPoint(URx, URy, URz); }
public void HorizontalAlignment_givenXYvalues_getStationOffsetValues() { List<IRM21fundamentalGeometry> fundmtlGeoms = createTestHA_fundGeom1(); rm21HorizontalAlignment HA = new rm21HorizontalAlignment( fundamentalGeometryList: fundmtlGeoms, Name: null, stationEquationing: null); StationOffsetElevation anSOE = null; bool allValuesAgree = true; // test point on first tangent ptsPoint somePoint = new ptsPoint(4046.2915, 3161.3216, 0.0); var soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(801.8849, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(0.0, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.00000001); } else { allValuesAgree = false; } // test point which is before the beginning of the HA somePoint = new ptsPoint(2500.0, 1000.0, 0.0); soePoints = HA.getStationOffsetElevation(somePoint); allValuesAgree &= soePoints.Count == 0; // test point which is beyond the end of the HA somePoint = new ptsPoint(9554.0, 9000.0, 0.0); soePoints = HA.getStationOffsetElevation(somePoint); allValuesAgree &= soePoints.Count == 0; // test point offset from first tangent somePoint.x = 4516.0; somePoint.y = 3404.0; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(1281.0297, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(223.4706, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point on first arc somePoint.x = 5494.3772; somePoint.y = 4664.3429; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(2930.4718, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(0.0, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point offset right of second arc somePoint.x = 6918.0; somePoint.y = 4557.0; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(4324.6956, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(183.2743, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point offset left of second arc somePoint.x = 7103.0; somePoint.y = 4979.0; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(4614.0481, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(-176.4468, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point offset left of third line (fifth segment somePoint.x = 8071.7032; somePoint.y = 5913.8278; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(6047.5668, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(-314.4057, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point offset at center of first arc somePoint.x = 5700.5429; somePoint.y = 3716.3124; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(2252.1594, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(970.1887, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } // test point offset right that returns 2 SOE instances for the same point somePoint.x = 5940.0; somePoint.y = 3310.0; soePoints = HA.getStationOffsetElevation(somePoint); if (soePoints != null && soePoints.Count > 0) { allValuesAgree &= (soePoints.Count == 2); anSOE = soePoints.FirstOrDefault(); allValuesAgree &= anSOE.station.tolerantEquals(3342.5539, 0.00014); allValuesAgree &= anSOE.offset.OFST.tolerantEquals(1382.4657, 0.00014); allValuesAgree &= anSOE.elevation.EL.tolerantEquals(0.0, 0.000001); } else { allValuesAgree = false; } Assert.IsTrue(allValuesAgree); }
public void expandByPoint(ptsPoint aPoint) { expandByPoint(aPoint.x, aPoint.y, aPoint.z); }
public double? givenXYgetSlopePercent(ptsPoint aPoint) { return givenXYgetSlopePercent((ptsDTMpoint)aPoint); }
public double? getElevation(ptsPoint aPoint) { return getElevation((ptsDTMpoint)aPoint); }
public double? getSlope(ptsPoint aPoint) { return getSlope((ptsDTMpoint)aPoint); }
public Double GetHorizontalDistanceTo(ptsPoint other) { Double dx = other.x - this.x; Double dy = other.y - this.y; return Math.Sqrt(dx * dx + dy * dy); }
public Azimuth getSlopeAzimuth(ptsPoint aPoint) { return getSlopeAzimuth((ptsDTMpoint)aPoint); }
public int compareByXthenY(ptsPoint other) { int xComp; int yComp; xComp = this.x_.CompareTo(other.x_); if (xComp == 0) { yComp = this.y_.CompareTo(other.y_); return yComp; } return xComp; }
public void testGetTriangle(ptsPoint aPoint) { aStopwatch = new Stopwatch(); System.Console.WriteLine("given a point, return containing Triangle:"); aStopwatch.Reset(); aStopwatch.Start(); ptsDTMtriangle singleTriangle = getTriangleContaining((ptsDTMpoint) aPoint); aStopwatch.Stop(); consoleOutStopwatch(aStopwatch); }
public ptsVector(ptsPoint beginPt, ptsPoint endPoint) { x = endPoint.x - beginPt.x; y = endPoint.y - beginPt.y; z = endPoint.z - endPoint.z; }
public void TIN_GardenParkwayTests_PointOnTriangleLineHasCorrectElevation() { if (null == GardenParkwayDTM) Assert.True(true); var testpoint = new ptsPoint(529666.7993, 1406618.4759); var expectedElevation = 673.8398; var actualElevation = GardenParkwayDTM.getElevation(testpoint); timerStopAndPrint(); Assert.AreEqual( expected: expectedElevation, actual: actualElevation, delta: 0.0001, message: "Elevation"); }