C 库函数 - sin()

C 语言教程 · 2019-02-23 07:28:02

描述

C 库函数 double sin(double x) 返回弧度角 x 的正弦。

声明

下面是 sin() 函数的声明。

double sin(double x)

参数

  • x -- 浮点值,代表了一个以弧度表示的角度。

返回值

该函数返回 x 的正弦。

实例

下面的实例演示了 sin() 函数的用法。

#include <stdio.h>
#include <math.h>

#define PI 3.14159265

int main ()
{
   double x, ret, val;

   x = 45.0;
   val = PI / 180;
   ret = sin(x*val);
   printf("%lf 的正弦是 %lf 度", x, ret);
   
   return(0);
}

让我们编译并运行上面的程序,这将产生以下结果:

45.000000 的正弦是 0.707107 度

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

More Eric Meyer on CSS (Voices That Matter)

More Eric Meyer on CSS (Voices That Matter)

Eric A. Meyer / New Riders Press / 2004-04-08 / USD 45.00

Ready to commit to using more CSS on your sites? If you are a hands-on learner who has been toying with CSS and want to experiment with real-world projects that will enable you to see how CSS......一起来看看 《More Eric Meyer on CSS (Voices That Matter)》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器