comparison test/Grids/geometry_test.jl @ 2015:5c2448d6a201 feature/grids/geometry_functions tip

Structure tests a bit more
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 09 May 2025 15:57:38 +0200
parents 7895b509f9bf
children
comparison
equal deleted inserted replaced
2014:6478c29effce 2015:5c2448d6a201
201 end 201 end
202 end 202 end
203 end 203 end
204 204
205 @testset "arc" begin 205 @testset "arc" begin
206 a = [0,0] 206 @testset "Half circles around [0.5, 0.0]" begin
207 b = [1,0] 207 a = [0,0]
208 A = arc(a,b,1/2) 208 b = [1,0]
209 @test A(0) ≈ a atol=1e-15 209
210 @test A(1) ≈ b 210 A = arc(a,b,1/2)
211 @test A(0.5) ≈ [0.5, -0.5] 211 @test A(0) ≈ a atol=1e-15
212 212 @test A(1) ≈ b
213 A = arc(a,b,-1/2) 213 @test A(0.5) ≈ [0.5, -0.5]
214 @test A(0) ≈ a atol=1e-15 214
215 @test A(1) ≈ b 215 A = arc(a,b,-1/2)
216 @test A(0.5) ≈ [0.5, 0.5] 216 @test A(0) ≈ a atol=1e-15
217 @test A(1) ≈ b
218 @test A(0.5) ≈ [0.5, 0.5]
219 end
217 220
218 @testset "Unit arc" begin 221 @testset "Unit arc" begin
219 A = arc([1,0],[0,1],1) 222 A = arc([1,0],[0,1],1)
220 @test A(0) ≈ [1,0] 223 @test A(0) ≈ [1,0]
221 @test A(1) ≈ [0,1] 224 @test A(1) ≈ [0,1]