Skip to content

Commit

Permalink
Add mtp(::Vector{U})
Browse files Browse the repository at this point in the history
  • Loading branch information
LuEdRaMo committed Jun 23, 2024
1 parent 7703227 commit e913dd8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NEOs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export gauss_method, gaussinitcond
# Orbit determination
export curvature, issinglearc, isgauss, orbitdetermination
# B plane
export valsecchi_circle, bopik
export valsecchi_circle, bopik, mtp
# Outlier rejection
export outlier_rejection

Expand Down
31 changes: 31 additions & 0 deletions src/postprocessing/b_plane.jl → src/postprocessing/bplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,35 @@ function valsecchi_circle(U_y, U_norm, k, h; m_pl=3.003489614915764e-6, a_pl=1.0
D0 = c*sinθ/(cosθ0p-cosθ)

return R0, D0
end

@doc raw"""
mtp(xae::Vector{U}) where {U <: Number}
Return the cartesian coordinates [Earth radii] on the modified
target plane of an asteroid's close approach with the Earth.
# Arguments
- `xae::Vector{U}`: asteroid's geocentric position/velocity
vector at close approach [au, au/day].
!!! reference
See equations (43)-(44) in page 15 of https://doi.org/10.1007/s10569-019-9914-4.
"""
function mtp(xae::Vector{U}) where {U <: Number}
# Unfold geocentric position and velocity
r, v = xae[1:3], xae[4:6]
# Reference direction
V = [0, 0, -1]
# Unit vectors
ez = v ./ euclid3D(v)
_ey_ = cross(V, ez)
ey = _ey_ ./ euclid3D(_ey_)
ex = cross(ey, ez)
# Cartesian coordinates [Earth radii]
X = dot3D(r, ex)*au/RE
Y = dot3D(r, ey)*au/RE

return X, Y
end
2 changes: 1 addition & 1 deletion src/postprocessing/outlier_rejection.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include("b_plane.jl")
include("bplane.jl")

@doc raw"""
residual_norm(x::OpticalResidual{T, T}) where {T <: Real}
Expand Down

0 comments on commit e913dd8

Please sign in to comment.