---
title: KIPL_Bsval
description: "计算basis样条拟合函数在位置x处的值。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0584.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0584.html
indexId: 30dbee33d9901bd09ab712a51a7e3923b22df1b138c2c81f732a14aee2aceee761
---
# KIPL_Bsval

计算basis样条拟合函数在位置x处的值。

#### 接口定义

float KIPL_Bsval(float xi, int k, float *xKnot, int ncoef, float *coef)


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| xi | 单精度浮点数 | 需要计算拟合值的位置。 | 输入 |
| ncoef | 整型数 | 表示coef数组长度，与nData相等。 | 输入 |
| k | 整型数 | 表示样条的阶数。 | 输入 |
| xKnot | 单精度浮点数组 | 长度为nData+k的数组，表示KIPL\_Bsnak生成的节点序列。 | 输入 |
| coef | 单精度浮点数组 | 长度为nData的数组，表示生成的系数序列。 | 输入 |
| 返回值 | 单精度浮点数 | basis样条拟合函数在位置x处的值。 | 输出 |


#### 依赖

#include "kipl.h"
