elips(3f) - [M_calcomp:general] draw an elliptical arc (LICENSE:PD)
Synopsis
Description
Options
Examples
License
subroutine elips(xpage,ypage,rmaj,rmin,angle,tho,thf,ipen)
ELIPS is a FORTRAN subroutine which draws an ellipse or elliptical arc.
XPAGE,YPAGE are the coordinates, in inches, of the starting point of the ellipse or arc. RMAJ,RMIN are the lengths, in inches, of the semi-major and semi-minor axes, respectively. ANGLE is the angle of the major axis, in degrees. THO,THF are the angles, in degrees with respect to ANGLE, of the arcs starting and ending points. IPEN is the code that moves the pen to the arcs starting point. If the value of IPEN is: 3, the pen is up for the move; 2, the pen is down for the move.
THO and THF may be positive or negative. If THO is less than THF, the arc is drawn in a counterclockwise direction; if THO is greater than THF, the arc is drawn in a clockwise direction.
Sample program:
program demo_elips use M_calcomp, only : plots, plot, newpen, factor, nframe, elips implicit none character(len=:),allocatable :: lines(:) integer :: i real :: x, y real :: a real :: major_axis_length, minor_axis_length real :: start_angle, finish_angle integer :: ipen integer,parameter :: END=999 lines=[character(len=80) :: & #---------------------------------------------------------------------#-,& # move over in the x direction the same amount you change axis length ,& #---------#---------#---------#---------#---------#---------#---------#-,& |6.5 !8.0 !0.5 !0.7 ! 0.0 ! 0.0 ! 360.0 !3,& |6.6 !8.0 !0.6 !0.6 ! 0.0 ! 0.0 ! 360.0 !3,& |6.7 !8.0 !0.7 !0.5 ! 0.0 ! 0.0 ! 360.0 !3,& |6.8 !8.0 !0.8 !0.4 ! 0.0 ! 0.0 ! 360.0 !3,& |6.9 !8.0 !0.9 !0.3 ! 0.0 ! 0.0 ! 360.0 !3,& |7.0 !8.0 !1.0 !0.2 ! 0.0 ! 0.0 ! 360.0 !3,& #---------#---------#---------#---------#---------#---------#---------#-,& # different end angles of different signs ,& #---------#---------#---------#---------#---------#---------#---------#-,& |5.0 !8.0 !1.0 !0.2 ! 0.0 ! 0.0 ! 45.0 !3,& |3.0 !8.0 !1.0 !0.2 ! 0.0 ! 0.0 ! -60.0 !3,& #---------#---------#---------#---------#---------#---------#---------#-,& # circles ,& #---------#---------#---------#---------#---------#---------#---------#-,& #---------#---------#---------#---------#---------#---------#---------#-,& # end of values to call ELIPS(3f) with ,& #---------------------------------------------------------------------#-] call plots(0.0,10.0,0.0,10.0) do i=1,size(lines) write(*,(a))lines(i) if( lines(i).eq. .or. index(lines(i),#).ne.0 )cycle read(lines(i),9012) x,y, & & major_axis_length,minor_axis_length, & & a, & & start_angle,finish_angle, & & ipen 9012 format(7(1X,F9.3),1X,I1) call elips(x,y, & & major_axis_length,minor_axis_length, & & a, & & start_angle,finish_angle, & & ipen) enddo call nframe() call plot(0.0,0.0,END) end program demo_elips
Public Domain
Nemo Release 3.1 | elips (3) | February 23, 2025 |