Esempio n. 1
0
float normalize_vn_vn(float *array_tar, const float *array_src, const int size)
{
	double d = len_squared_vn(array_src, size);
	float d_sqrt;
	if (d > 1.0e-35) {
		d_sqrt = (float)sqrt(d);
		mul_vn_vn_fl(array_tar, array_src, size, 1.0f / d_sqrt);
	}
	else {
		fill_vn_fl(array_tar, size, 0.0f);
		d_sqrt = 0.0f;
	}
	return d_sqrt;
}
Esempio n. 2
0
static PyObject *color_mul_float(ColorObject *color, const float scalar)
{
	float tcol[COLOR_SIZE];
	mul_vn_vn_fl(tcol, color->col, COLOR_SIZE, scalar);
	return Color_CreatePyObject(tcol, Py_NEW, Py_TYPE(color));
}