辅助数据拟合
This commit is contained in:
@@ -15,7 +15,7 @@ type IntersectionPoint struct {
|
||||
H float64
|
||||
}
|
||||
|
||||
func IntersectionAttitude(q Quaternion, satPosECI, satPos84 []float64, satTime time.Time, ucam int) (IntersectionPoint, error) {
|
||||
func IntersectionAttitude(q Quaternion, satPos84 []float64, satTime time.Time, ucam int) (IntersectionPoint, error) {
|
||||
// alpha := FOV * math.Pi / 180.0
|
||||
// alpha = -alpha/2.0 + float64(ucam)*(alpha/float64(PANPixels))
|
||||
// direction := []float64{0, math.Tan(alpha), -1.3}
|
||||
@@ -33,18 +33,15 @@ func IntersectionAttitude(q Quaternion, satPosECI, satPos84 []float64, satTime t
|
||||
dECI := result.RawVector().Data
|
||||
|
||||
// -------- 转到ECEF坐标系 --------
|
||||
// x, y, z := ECItoECEF(dECI[0], dECI[1], dECI[2], satTime)
|
||||
// dECEF := []float64{x, y, z}
|
||||
x, y, z := ECItoECEF(dECI[0], dECI[1], dECI[2], satTime)
|
||||
dECEF := []float64{x, y, z}
|
||||
|
||||
// -------- 计算与地球表面的交点 --------
|
||||
intersection, err := intersectWithEllipsoid(satPosECI, dECI)
|
||||
intersection, err := intersectWithEllipsoid(satPos84, dECEF)
|
||||
if err != nil {
|
||||
return IntersectionPoint{}, err
|
||||
}
|
||||
|
||||
x, y, z := ECItoECEF(intersection[0], intersection[1], intersection[2], satTime)
|
||||
intersection = []float64{x, y, z}
|
||||
|
||||
lat, lon, h := ECEFGeocentricToGeodetic(intersection[0], intersection[1], intersection[2])
|
||||
return IntersectionPoint{Lat: lat, Lon: lon, H: h}, nil
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package calculator
|
||||
import "math"
|
||||
|
||||
func WGS84XYZtoLatLngH(X, Y, Z float64) (float64, float64, float64) {
|
||||
return ECEFToGeodetic(X, Y, Z)
|
||||
return ECEFGeocentricToGeodetic(X, Y, Z)
|
||||
}
|
||||
|
||||
// Function to convert ECEF (ITRS) coordinates to geodetic coordinates (latitude, longitude, height)
|
||||
|
||||
Reference in New Issue
Block a user