Trig functions and square root in native batch?

后端 未结 2 1751
盖世英雄少女心
盖世英雄少女心 2021-01-27 23:08

I am making a tool where the user is shown this triangle throughout the process:

:draw
echo   ^|\\
echo   ^|a\\
echo   ^|  \\
echo   ^|   \\
echo   ^|    \\ C
ec         


        
2条回答
  •  情歌与酒
    2021-01-27 23:40

    here this works:

    @echo off
    echo what number do you want to get the sin cos and tan values from of?
    set /p in=num:
    for /f "delims=" %%a in (' powershell "[Math]::sin(%in%)" ') do set "sin=%%a"
    echo the sin of %in% is %sin%
    for /f "delims=" %%a in (' powershell "[Math]::cos(%in%)" ') do set "cos=%%a"
    echo the cos of %in% is %cos%
    for /f "delims=" %%a in (' powershell "[Math]::tan(%in%)" ') do set "tan=%%a"
    echo the tan of %in% is %tan%
    pause
    

提交回复
热议问题