コード例 #1
0
ファイル: BEMCell.cpp プロジェクト: WilliamHammond/Research
//*******************************************************
//function name: sinKP 
// construct single vector of PK for each (point, element)pair
// note: need to consider factors such as whether the point is in the element and whether it's related to the shape function
// being processed
//*******************************************************
void Tri3Cell::sinKP(BEM& bem, int isIn, int isFirst)
{
	if (isIn == 0)
		numInt(bem, isFirst);
	else
		sinInt();
}
コード例 #2
0
ファイル: MathInt.cpp プロジェクト: NFAteam/Arduino-3
int TMathInt::cosInt(long t)
{
	if (t < 0)
	{
		return cosInt(-t);
	}
	return sinInt(t + 1024);
}
コード例 #3
0
ファイル: MathInt.cpp プロジェクト: NFAteam/Arduino-3
int TMathInt::sinInt(long t)
{
	if (t < 0)
	{
		return -sinInt(-t);
	}
	
	t = t & 0x00000FFF; // 2Pi = 4096
	if (t <= 1024)
	{
		return sinArray[t];
	}
	else if (t <= 2048)
	{
		return sinArray[2048 - t];
	}
	else if (t <= 3072)
	{
		return -sinArray[t - 2048];
	}
	else return -sinArray[4096 - t];
}