Контур по параметрам съемочного устройства
This commit is contained in:
@@ -17,6 +17,76 @@ import kotlin.math.sqrt
|
||||
class PointOnEarthCalculator(val earthType: EarthType, private val wcs: WorkCSType) {
|
||||
private var astro = AstronomerJ2000(earthType)
|
||||
|
||||
|
||||
|
||||
fun pointOnEarth(
|
||||
point: OrbitalPoint,
|
||||
orientation: Orientation,
|
||||
x : Double,
|
||||
y : Double,
|
||||
focus : Double
|
||||
|
||||
): THBLPoint? {
|
||||
val krenMax = asin((astro.earth.polarRadius - 50000.0) / point.r.module())
|
||||
if (orientation.kren > krenMax) {
|
||||
orientation.kren = krenMax
|
||||
}
|
||||
if (orientation.kren < -krenMax) {
|
||||
orientation.kren = -krenMax
|
||||
}
|
||||
|
||||
val rabs: Vector3D
|
||||
val vabs: Vector3D
|
||||
|
||||
if (wcs == WorkCSType.WCSPath) {
|
||||
rabs = point.r
|
||||
vabs = point.v
|
||||
} else {
|
||||
val ask = astro.grinvToASK(point)
|
||||
|
||||
rabs = ask.r
|
||||
vabs = ask.v
|
||||
}
|
||||
val dd: Vector3D
|
||||
val c = Matrix3D()
|
||||
c.second = rabs.basis()
|
||||
c.third = (vabs.rem(rabs)).basis()
|
||||
c.first = c.second.rem(c.third)
|
||||
var ct = c.transpose()
|
||||
val aa =
|
||||
Matrix3D(
|
||||
Vector3D(
|
||||
cos(orientation.tang) * cos(orientation.risk) - sin(orientation.tang) * sin(orientation.kren) * sin(orientation.risk),
|
||||
-sin(orientation.tang) * cos(orientation.kren),
|
||||
cos(orientation.tang) * sin(orientation.risk) + sin(orientation.tang) * sin(orientation.kren) * cos(orientation.risk),
|
||||
),
|
||||
Vector3D(
|
||||
sin(orientation.tang) * cos(orientation.risk) + cos(orientation.tang) * sin(orientation.kren) * sin(orientation.risk),
|
||||
cos(orientation.tang) * cos(orientation.kren),
|
||||
sin(orientation.tang) * sin(orientation.risk) - cos(orientation.tang) * sin(orientation.kren) * cos(orientation.risk),
|
||||
),
|
||||
Vector3D(
|
||||
-cos(orientation.kren) * sin(orientation.risk),
|
||||
sin(orientation.kren),
|
||||
cos(orientation.kren) * cos(orientation.risk),
|
||||
),
|
||||
)
|
||||
if (wcs == WorkCSType.WCSOrbit) {
|
||||
val g = Matrix3D()
|
||||
g.makeOzMatrix(astro.si2000(point.t))
|
||||
ct = g.transpose() * ct
|
||||
}
|
||||
|
||||
val k = ct * aa
|
||||
|
||||
val d = Vector3D(y / 1000.0, focus / 1000.0, x / 1000).basis()
|
||||
|
||||
dd = k * d
|
||||
|
||||
return earthIntersection(point.t, point.r, dd)
|
||||
}
|
||||
|
||||
|
||||
fun pointOnEarth(
|
||||
point: OrbitalPoint,
|
||||
orientation: Orientation,
|
||||
|
||||
Reference in New Issue
Block a user