Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module triangles
- implicit none
- type, public :: triangle
- private
- real, dimension(3):: x,y
- real :: centerX, centerY
- contains
- procedure::rotate
- generic::operator(.rotate.)=>rotate
- end type
- contains
- function rotate(a,b) result (c)
- class(triangle), intent(in)::a
- class(triangle), allocatable::c
- real, intent(in)::b
- c.x=a.x*cos(b)+a.y*sin(b)
- c.y=-a.x*sin(b)+a.y*cos(b)
- end function rotate
- end module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement