arrowhead(3f) - [M_drawplus] Draw arrow head (for text boxes and line markers) (LICENSE:MIT)
Synopsis
Description
Example
Author
License
subroutine arrowhead(xpoint,ypoint,xstart,ystart,size,idraw)
real,intent(in) :: xpoint,ypoint real,intent(in) :: xstart,ystart real,intent(in) :: size integer,intent(in) :: idraw
given line segment
START --> POINTdraw an arrow head of overall length SIZE measured along the line segment. The arrow head is 2/3 SIZE wide and the indent is 1/3 SIZE.
if IDRAW is 0, draw line from x3 to START to P3 and leave current position at POINT.
> o START > | > | > | > | > | 1/3*size > |<-------> > | > | > P1 o . | . o P2 --------- > \ . | . / ^ > \ . | . / | > \ o P3 / ------- | > \ / ^ SIZE > \ / | | > \ / 2/3*SIZE | > \ / V V > \ / ----------------- > o POINT
Sample program:
program demo_arrowhead use :: M_draw use :: M_drawplus, only : arrowhead implicit none real :: xpoint,ypoint, xstart,ystart real :: PI, ang, size integer :: i, idraw, idum call prefsize(600,600) call vinit() call ortho2(-10.0,10.0,-10.0,10.0) call linewidth(100) call color(D_WHITE) call clear() xstart=0.0 ystart=0.0 size=1.00 idraw=0call color(D_RED) xpoint=9.0 ypoint=0.0 call arrowhead(xpoint,ypoint,xstart,ystart,size,idraw)
call color(D_GREEN) xpoint=9.0 ypoint=9.0 call arrowhead(xpoint,ypoint,xstart,ystart,size,idraw)
call color(D_BLACK) idraw=-1 PI=4.0*atan(1.0) ang=PI/2.0 do i=1,20+1 xpoint=9.0*cos(ang) ypoint=9.0*sin(ang) call arrowhead(xpoint,ypoint,xstart,ystart,size,idraw) ang=ang+PI/20.0 enddo idum=getkey() call vexit() end program demo_arrowhead
John S. Urban
MIT License
Nemo Release 3.1 | arrowhead (3) | February 23, 2025 |