Mercurial > repos > public > sbplib_julia
comparison test/Grids/geometry_test.jl @ 2013:7895b509f9bf feature/grids/geometry_functions
Implement Grids.jacobian for Arc
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 07 May 2025 15:25:25 +0200 |
| parents | 4617e4b74b82 |
| children | 5c2448d6a201 |
comparison
equal
deleted
inserted
replaced
| 2012:4617e4b74b82 | 2013:7895b509f9bf |
|---|---|
| 175 @test a(1/2) ≈ [1/√(2),1/√(2)] | 175 @test a(1/2) ≈ [1/√(2),1/√(2)] |
| 176 @test a(2/3) ≈ [1/2, √(3)/2] | 176 @test a(2/3) ≈ [1/2, √(3)/2] |
| 177 @test a(1) ≈ [0,1] | 177 @test a(1) ≈ [0,1] |
| 178 | 178 |
| 179 @testset "Grids.jacobian" begin | 179 @testset "Grids.jacobian" begin |
| 180 @test_broken false | 180 c = Circle([0,0], 1) |
| 181 | |
| 182 @testset "Matched to circle" begin | |
| 183 a = Arc(c, 0, 1) | |
| 184 @testset for t ∈ range(0,1,8) | |
| 185 @test jacobian(a,t) ≈ jacobian(c,t) | |
| 186 end | |
| 187 end | |
| 188 | |
| 189 @testset "Full circle" begin | |
| 190 a = Arc(c, 0, 2π) | |
| 191 @testset for t ∈ range(0,1,8) | |
| 192 @test jacobian(a,t) ≈ 2π*jacobian(c,t) | |
| 193 end | |
| 194 end | |
| 195 | |
| 196 @testset "Other" begin | |
| 197 a = Arc(c, π/3, 5π/4) | |
| 198 @testset for t ∈ range(0,1,8) | |
| 199 @test jacobian(a,t) ≈ 11π/12*jacobian(c,t) | |
| 200 end | |
| 201 end | |
| 181 end | 202 end |
| 182 end | 203 end |
| 183 | 204 |
| 184 @testset "arc" begin | 205 @testset "arc" begin |
| 185 a = [0,0] | 206 a = [0,0] |
