コード例 #1
0
ファイル: Triple.cpp プロジェクト: costrouc/undergrad-codings
bool Triple::EpsilonEquals(Triple t, double d)
{
  assert(d >= 0);
  if (GetX() - t.GetX() < d && GetX() - t.GetX() > -d)
    {
      if (GetY() - t.GetY() < d && GetY() - t.GetY() > -d)
	{
	  if (GetZ() - t.GetZ() < d && GetZ() - t.GetZ() > -d)
	    {
	      return true;
	    }
	}
    }
  return false;
}
コード例 #2
0
ファイル: Triple.cpp プロジェクト: costrouc/undergrad-codings
bool Triple::Equals(Triple t)
{
  if (GetX() == t.GetX())
    {
      if (GetY() == t.GetY())
	{
	  if (GetZ() == t.GetZ())
	    {
	      return true;
	    }
	}
    }
  return false;
}
コード例 #3
0
ファイル: Triple.cpp プロジェクト: costrouc/undergrad-codings
void Triple::Add(Triple t)
{
  SetX(GetX() + t.GetX());
  SetY(GetY() + t.GetY());
  SetZ(GetZ() + t.GetZ());
}