This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ForwardDiff | |
| const T = Float64 # the datatype used, probably Float64 | |
| const dof = 4 | |
| fn!(;T_::Type=T, dof_=dof) = zeros(T_,dof_) | |
| function fn!(res, y)#, dydt) | |
| @show typeof(res), typeof(y) | |
| for i=1:dof |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Determines the winding number of a point and a polygon, i.e. how many | |
| times a polygon winds around the point. | |
| It follows Dan Sunday: http://geomalgorithms.com/a03-_inclusion.html. | |
| """ | |
| function windnr(p, poly::Matrix) | |
| @assert length(p)==2 | |
| @assert poly[:,1]==poly[:,end] | |
| # Loop over edges |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [deps] | |
| PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # löse aufgabe a/b=0.567567567567567567567567567567567567 | |
| # für a und b integer | |
| # | |
| # Plan: b * 0.567567567567567567567567567567567567 muss ein Integer sein, test für viele b's | |
| c = 0.567567567567567567 | |
| for b in (1:10000000) | |
| a = b * c | |
| if isapprox(a, round(a), atol= 0.000000001) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [deps] | |
| IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" | |
| [compat] | |
| julia = "1.10" |
OlderNewer