Mercurial > repos > public > sbplib_julia
comparison src/Grids/geometry.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 |
|---|---|
| 32 return LineSegment{typeof(a)}(a,b) | 32 return LineSegment{typeof(a)}(a,b) |
| 33 end | 33 end |
| 34 | 34 |
| 35 (c::LineSegment)(s) = (1-s)*c.a + s*c.b | 35 (c::LineSegment)(s) = (1-s)*c.a + s*c.b |
| 36 | 36 |
| 37 Grids.jacobian(c::LineSegment, s) = c.b - c.a | |
| 37 | 38 |
| 38 function linesegments(ps...) | 39 function linesegments(ps...) |
| 39 return [LineSegment(ps[i], ps[i+1]) for i ∈ 1:length(ps)-1] | 40 return [LineSegment(ps[i], ps[i+1]) for i ∈ 1:length(ps)-1] |
| 40 end | 41 end |
| 41 | 42 |
