Skip to content
Snippets Groups Projects
Commit bedad30a authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch 'move-angle-to-km3io' into 'master'

Move angle to KM3io

See merge request !5
parents 8f418b86 04249e23
No related branches found
No related tags found
1 merge request!5Move angle to KM3io
Pipeline #48316 passed
......@@ -39,7 +39,7 @@ DocStringExtensions = "^0.8, ^0.9"
HDF5 = "^0.16, ^0.17"
HTTP = "^1"
KM3NeTTestData = "^0.4.7"
KM3io = "^0.15.0, ^0.16.2"
KM3io = "^0.16.3"
LandauDistribution = "^0.2"
ProgressMeter = "^1"
RecipesBase = "^0.7, ^0.8, ^1"
......
Base.angle(d1, d2) = acos(min(dot(normalize(d1), normalize(d2)), 1))
# TODO: type piracy: this needs to go to KM3io
Base.angle(a::T, b::T) where {T<:Union{KM3io.AbstractCalibratedHit, KM3io.PMT}} = Base.angle(a.dir, b.dir)
Base.angle(a, b::Union{KM3io.AbstractCalibratedHit, KM3io.PMT}) = Base.angle(a, b.dir)
Base.angle(a::Union{KM3io.AbstractCalibratedHit, KM3io.PMT}, b) = Base.angle(a.dir, b)
"""
Calculate the cartesian coordinates for given `ϕ`, `θ` and radius `r`.
"""
......
......@@ -2,14 +2,6 @@ using NeRCA
using Test
@testset "angle()" begin
@test 0 == angle([1,0,0], [1,0,0])
@test π/2 angle([1,0,0], [0,1,0])
@test π/2 angle([1,0,0], [0,0,1])
@test π angle([1,0,0], [-1,0,0])
end
@testset "spread()" begin
directions = [
Direction(1.0, 0.0, 0.0),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment