-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunction.cpp
More file actions
48 lines (38 loc) · 1.21 KB
/
Copy pathfunction.cpp
File metadata and controls
48 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**************************************************************************** **
* Copyright (C) 2001-2020 Inhand Networks, Inc.
**************************************************************************** **/
/* ************************************************************************** **
* MODULE NAME : system
* LANGUAGE : C++
* TARGET ENVIRONMENT : Any
* FILE NAME : function.cpp
* FIRST CREATION DATE : 2021/05/09
* --------------------------------------------------------------------------
* Version : 1.0
* Author : EExuke
* Last Change : 2021/05/09
* FILE DESCRIPTION :
** ************************************************************************** */
#include <iostream>
#include "function.h"
using namespace std;
//2-1计算圆周长
float GetPerimeter(float fRadius)
{
float fPerimeter = 0;
fPerimeter = 2 * PI * fRadius;
return fPerimeter;
}
//2-2分段函数
int GetPiecewise(int x)
{
if (x<0 || x>3000) {
printf("Error:input arg:x out of domain.");
return -1;
}
if (x <= 1000) {
return 18000*x;
} else if(x < 3000) {
return 18000 + 16000(x-1000) - 50000;
}
}