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

查看所有标签

数学拾遗

数学拾遗

加黑蒂 / 清华大学出版社 / 2004-8 / 49.00元

Beginning graduate students in mathematics and other quantitative subjects are expected to have a daunting breadth of mathematical knowledge ,but few have such a backgroud .This book will help stedent......一起来看看 《数学拾遗》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具