楕円の作図
<ellipse.bat>
--------------------
@REM 楕円の作図
@echo off
REM
REM #jww
REM #cd
REM #0 中心位置を指定してください
REM #1 長径(短径)を指示してください
REM #2 短径(長径)を指示してください
REM #hr
REM #e
REM
jgawk -f ellipse.awk jwc_temp.txt>temp.txt
copy temp.txt jwc_temp.txt
del temp.txt
<ellipse.awk>
--------------------
#楕円の作図
#初期設定
BEGIN{pi=atan2(0,-1)}
#半径/軸角の取得
/^hp1/{xh=$2;yh=$3;rh=sqrt(xh^2+yh^2);
angh=atan2(yh,xh);angh=angh*180/pi}
/^hp2/{xv=$2;yv=$3;rv=sqrt(xv^2+yv^2)}
END{r=rh;k=rv/rh;ang=angh;
#楕円データの書出し
printf "%s %d %d %.15g %d %d %.15g %.15g\n","ci",0,0,r,0,360,k,ang}
| 固定リンク
コメント