Контур по параметрам съемочного устройства
This commit is contained in:
+7
-7
@@ -20,28 +20,28 @@ class SurveyContourCalculator(
|
||||
) {
|
||||
private val pointOnEarthCalculator = PointOnEarthCalculator(earthType, wcs)
|
||||
|
||||
fun calculate(result: AngularMotionResult, captureAngleDeg: Double): String {
|
||||
require(captureAngleDeg > 0.0 && captureAngleDeg.isFinite()) {
|
||||
"Угол захвата аппаратуры должен быть положительным"
|
||||
}
|
||||
fun calculate(result: AngularMotionResult, y: Double,z: Double,focus: Double): String {
|
||||
|
||||
|
||||
val sourcePoints = result.points
|
||||
require(sourcePoints.size >= MIN_CONTOUR_POINTS) {
|
||||
"Для построения контура съемки требуется не менее $MIN_CONTOUR_POINTS точек ПУУД"
|
||||
}
|
||||
|
||||
val captureAngleRad = captureAngleDeg.toRadians()
|
||||
val right = ArrayList<SurveyContourPoint>(sourcePoints.size)
|
||||
val left = ArrayList<SurveyContourPoint>(sourcePoints.size)
|
||||
|
||||
sourcePoints.forEach { point ->
|
||||
val rightPoint = pointOnEarthCalculator.pointOnEarth(
|
||||
point.orbitalPoint,
|
||||
point.orientation.withKren(point.orientation.kren + captureAngleRad),
|
||||
point.orientation,
|
||||
z, y, focus
|
||||
|
||||
)
|
||||
val leftPoint = pointOnEarthCalculator.pointOnEarth(
|
||||
point.orbitalPoint,
|
||||
point.orientation.withKren(point.orientation.kren - captureAngleRad),
|
||||
point.orientation,
|
||||
-z, y, focus
|
||||
)
|
||||
|
||||
if (rightPoint != null && leftPoint != null) {
|
||||
|
||||
+3
-1
@@ -13,6 +13,7 @@ import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.Locale
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.atan
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
import kotlin.test.Test
|
||||
@@ -73,7 +74,8 @@ class AngularMotionCalculatorSmokeTest {
|
||||
)
|
||||
)
|
||||
|
||||
val wkt = SurveyContourCalculator().calculate(result, captureAngleDeg = 1.5)
|
||||
val wkt = SurveyContourCalculator().calculate(result, 0.0, AngularMotionConfig().focus * atan(1.5 * PI / 180),
|
||||
AngularMotionConfig().focus)
|
||||
val coordinates = wkt
|
||||
.removePrefix("POLYGON ((")
|
||||
.removeSuffix("))")
|
||||
|
||||
Reference in New Issue
Block a user