/** * __fixp_sin32() returns the sin of an angle in degrees * * @degrees: angle, in degrees, from 0 to 360. * * The returned value ranges from -0x7fffffff to +0x7fffffff.
*/ staticinline s32 __fixp_sin32(int degrees)
{
s32 ret; bool negative = false;
/** * fixp_sin32() returns the sin of an angle in degrees * * @degrees: angle, in degrees. The angle can be positive or negative * * The returned value ranges from -0x7fffffff to +0x7fffffff.
*/ staticinline s32 fixp_sin32(int degrees)
{
degrees = (degrees % 360 + 360) % 360;
/** * fixp_sin32_rad() - calculates the sin of an angle in radians * * @radians: angle, in radians * @twopi: value to be used for 2*pi * * Provides a variant for the cases where just 360 * values is not enough. This function uses linear * interpolation to a wider range of values given by * twopi var. * * Experimental tests gave a maximum difference of * 0.000038 between the value calculated by sin() and * the one produced by this function, when twopi is * equal to 360000. That seems to be enough precision * for practical purposes. * * Please notice that two high numbers for twopi could cause * overflows, so the routine will not allow values of twopi * bigger than 1^18.
*/ staticinline s32 fixp_sin32_rad(u32 radians, u32 twopi)
{ int degrees;
s32 v1, v2, dx, dy;
s64 tmp;
/* * Avoid too large values for twopi, as we don't want overflows.
*/
BUG_ON(twopi > 1 << 18);
/** * fixp_linear_interpolate() - interpolates a value from two known points * * @x0: x value of point 0 * @y0: y value of point 0 * @x1: x value of point 1 * @y1: y value of point 1 * @x: the linear interpolant
*/ staticinlineint fixp_linear_interpolate(int x0, int y0, int x1, int y1, int x)
{ if (y0 == y1 || x == x0) return y0; if (x1 == x0 || x == x1) return y1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.