亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

誰能幫我找出其中的問題? 反三角函數 應該怎么寫?

誰能幫我找出其中的問題? 反三角函數 應該怎么寫?

C
慕俠2389804 2023-04-22 17:13:33
#include<stdio.h> #include<math.h> int main() { double a;a=sin(45);printf("f%",a);}為什么不能顯示45度角的對邊比斜邊??顯示的是f
查看完整描述

2 回答

?
陪伴而非守候

TA貢獻1757條經驗 獲得超8個贊

要用弧度計算的,另外,pintf語句中,應該是"%lf",不是"f%"

sin()是三角函數,參數使用的是弧度,不是度。

asin()才是反三角函數。

資料 :

NAME
asin, asinf, asinl - arc sine function

SYNOPSIS
#include <math.h>

double asin(double x);
float asinf(float x);
long double asinl(long double x);

Link with -lm.

DESCRIPTION
The asin() function calculates the arc sine of x; that is the value
whose sine is x. If x falls outside the range -1 to 1, asin() fails
and errno is set.

RETURN VALUE
The asin() function returns the arc sine in radians and the value is
mathematically defined to be between -PI/2 and PI/2 (inclusive). 

查看完整回答
反對 回復 2023-04-25
?
江戶川亂折騰

TA貢獻1851條經驗 獲得超5個贊

幫你更正一下:
int main() 

const double pi=3.14; //定義pi的值
double a; 
a=sin(45*pi/180); //角度轉化為弧度
printf("%f",a); //printf的正確格式
}

查看完整回答
反對 回復 2023-04-25
  • 2 回答
  • 0 關注
  • 190 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號