|
已知一個(gè)等腰三角形三個(gè)邊ABC的長(zhǎng)度,AB=75,AC=75,BC=19,求這個(gè)等腰三角形的頂角角度是多少(不是直角等腰三角形)
cosA=(AB2+AC2-BC2)/(2AB×AC) =(752+752-192)/(2×75×75)=0.96791111111111111111111111111111
A=14.554027753139177660897660110218°
cosA=1 - BC2/2AB2
- //sides of a triangle 等腰三角形的三邊都知道求角度?
- const int a = 75; // 等腰三角形的等邊
- const int c = 19;
- float A; // 其余弦值
- //angles of the triangle
- float C; // 等腰三角形的頂角角度
- void setup() {
- // put your setup code here, to run once:
- // initialize the serial communication:
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- A = 1.0 - ((float)(c*c)/ (float)(2*a*a));
- Serial.println(A); // 其余弦值 cos(A)
- C = acos(A);
- Serial.println(C); // 等腰三角形的頂角弧度
- C = C/3.141592654 *180;
- Serial.println(C); //等腰三角形的頂角角度
- delay(5000);
- }
復(fù)制代碼 |
|