Skip to content

Commit

Permalink
🐛 Allow defining OrbitStateVector with SVectors
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
ronisbr committed Apr 5, 2023
1 parent 2db4b43 commit df26e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/types/orbit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
export Orbit, KeplerianElements, OrbitStateVector

"""
Orbit{Tepoch <: Number, T <: Number}
abstract type Orbit{Tepoch<:Number, T<:Number}
Abstract type of an orbit representation.
"""
abstract type Orbit{Tepoch <: Number, T <: Number} end
abstract type Orbit{Tepoch<:Number, T<:Number} end

"""
KeplerianElements{Tepoch <: Number, T <: Number} <: Orbit{Tepoch, T}
KeplerianElements{Tepoch<:Number, T<:Number} <: Orbit{Tepoch, T}
This structure defines the orbit in terms of the Keplerian elements.
Expand All @@ -31,7 +31,7 @@ This structure defines the orbit in terms of the Keplerian elements.
- `ω::T`: Argument of perigee [rad].
- `f::T`: True anomaly [rad].
"""
struct KeplerianElements{Tepoch <: Number, T <: Number} <: Orbit{Tepoch, T}
struct KeplerianElements{Tepoch<:Number, T<:Number} <: Orbit{Tepoch, T}
t::Tepoch
a::T
e::T
Expand Down Expand Up @@ -72,7 +72,7 @@ function KeplerianElements(
end

"""
OrbitStateVector{Tepoch, T}
struct OrbitStateVector{Tepoch<:Number, T<:Number} <: Orbit{Tepoch, T}
Store the state vector representation of an orbit.
Expand All @@ -83,7 +83,7 @@ Store the state vector representation of an orbit.
- `v::SVector{3, T}`: Velocity vector [m/s].
- `a::SVector{3, T}`: Acceleration vector [m/s²].
"""
struct OrbitStateVector{Tepoch, T} <: Orbit{Tepoch, T}
struct OrbitStateVector{Tepoch<:Number, T<:Number} <: Orbit{Tepoch, T}
t::Tepoch
r::SVector{3, T}
v::SVector{3, T}
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ end
include("./time/issues.jl")
end
end

@testset "Issues" verbose = true begin
include("./issues.jl")
end

0 comments on commit df26e8e

Please sign in to comment.