Mercurial > repos > public > sbplib_julia
comparison test/Grids/geometry_test.jl @ 1975:79adad4a15d6 feature/grids/geometry_functions
Implement Grids.jacobian for LineSegment
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 25 Feb 2025 22:42:14 +0100 |
parents | 3ed7ca1f60c4 |
children | 34a7e3919e9a |
comparison
equal
deleted
inserted
replaced
1974:3ed7ca1f60c4 | 1975:79adad4a15d6 |
---|---|
47 l = LineSegment([1,2],[2,3]) | 47 l = LineSegment([1,2],[2,3]) |
48 | 48 |
49 @test l(0) == [1,2] | 49 @test l(0) == [1,2] |
50 @test l(1) == [2,3] | 50 @test l(1) == [2,3] |
51 @test l(1/2) == [1,2]/2 + [2,3]/2 | 51 @test l(1/2) == [1,2]/2 + [2,3]/2 |
52 end | |
53 | |
54 @testset "Grids.jacobian" begin | |
55 a, b = [1,2], [2,3] | |
56 l = LineSegment(a,b) | |
57 d = b-a | |
58 | |
59 @test Grids.jacobian(l,0) == d | |
60 @test Grids.jacobian(l,1) == d | |
61 @test Grids.jacobian(l,1/2) == d | |
52 end | 62 end |
53 end | 63 end |
54 | 64 |
55 @testset "linesegments" begin | 65 @testset "linesegments" begin |
56 a,b,c,d = [1,1],[2,2],[3,3],[4,4] | 66 a,b,c,d = [1,1],[2,2],[3,3],[4,4] |