tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
35
Task/Ray-casting-algorithm/Fortran/ray-casting-algorithm-1.f
Normal file
35
Task/Ray-casting-algorithm/Fortran/ray-casting-algorithm-1.f
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
module Polygons
|
||||
use Points_Module
|
||||
implicit none
|
||||
|
||||
type polygon
|
||||
type(point), dimension(:), allocatable :: points
|
||||
integer, dimension(:), allocatable :: vertices
|
||||
end type polygon
|
||||
|
||||
contains
|
||||
|
||||
function create_polygon(pts, vt)
|
||||
type(polygon) :: create_polygon
|
||||
type(point), dimension(:), intent(in) :: pts
|
||||
integer, dimension(:), intent(in) :: vt
|
||||
|
||||
integer :: np, nv
|
||||
|
||||
np = size(pts,1)
|
||||
nv = size(vt,1)
|
||||
|
||||
allocate(create_polygon%points(np), create_polygon%vertices(nv))
|
||||
create_polygon%points = pts
|
||||
create_polygon%vertices = vt
|
||||
|
||||
end function create_polygon
|
||||
|
||||
subroutine free_polygon(pol)
|
||||
type(polygon), intent(inout) :: pol
|
||||
|
||||
deallocate(pol%points, pol%vertices)
|
||||
|
||||
end subroutine free_polygon
|
||||
|
||||
end module Polygons
|
||||
Loading…
Add table
Add a link
Reference in a new issue