线性函数,C语言方式实现

                                   线性函数,C语言方式实现

GitHub仓库:https://github.com/XinLiGH/LinearFunction

PS:博文不再更新,后续更新会在GitHub仓库进行。

 

线性函数,C语言方式实现。程序中涉及到线性函数的概念,详细介绍见维基百科[Linear function](https://en.wikipedia.org/wiki/Linear_function)。

 

1,开发环境

1,操作系统:Windows 10 专业版

2,IDE:Visual Studio 2017 专业版

 

2,程序源码

LinearFunction.h文件

/**
  ******************************************************************************
  * @file    LinearFunction.h
  * @author  XinLi
  * @version v1.0
  * @date    13-September-2018
  * @brief   Header file for LinearFunction.c module.
  ******************************************************************************
  * @attention
  *
  * <h2><center>Copyright &copy; 2018 XinLi</center></h2>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
  ******************************************************************************
  */

#ifndef __LINEARFUNCTION_H
#define __LINEARFUNCTION_H

#ifdef __cplusplus
extern "C" {
#endif

/* Header includes -----------------------------------------------------------*/
/* Macro definitions ---------------------------------------------------------*/
/* Type definitions ----------------------------------------------------------*/
typedef struct
{
  float slope;
  float intercept;
}LinearFunction;

/* Variable declarations -----------------------------------------------------*/
/* Variable definitions ------------------------------------------------------*/
/* Function declarations -----------------------------------------------------*/
void LinearFunction_PointSlopeInit(LinearFunction *function, float x, float y, float slope);
void LinearFunction_TwoPointInit(LinearFunction *function, float x1, float y1, float x2, float y2);

void LinearFunction_SetSlope(LinearFunction *function, float slope);
voi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值